動態 load javascript file
by thinker
關鍵字:
最後更新時間:
2006-08-12 13:42:25 CST |
引用
查詢:
COMMENTS:
on 2007-02-03 03:32:09 CST
pan said ..
Excellent idea. I've been trying to find a good way to load js for a long time.
Isn't it true that ActiveXObject should be included for a better browser coverage ?
on 2007-02-03 03:50:05 CST
pan said ..
This is what I use to import a js. Unfortunately, it only works in IE. In Firefox, it has to wait until the document is fully loaded.
function importjs(x){ var <br>
s=document.body.appendChild( <br>
document.createElement('script')); <br>
s.language='javascript';void(s.src=x);}
on 2007-02-03 03:51:45 CST
pan said ..
mmmhhh... trying to share my code for how I did this load js thingy but the comment didn't show up after I hit [Submit Comment] ...
on 2007-02-03 03:55:18 CST
pan said ..
Oh, I have to refresh the page for it to show up ... this doesn't feel right. Hitting [Submit Comment] should have made it refresh automatically.
Also, as you can see, your commenting system doesn't allow good code display. This becomes a big problem in a heavily programming oriented site ...
i should stop here otherwise my comments getting to look like spam ...
on 2007-02-03 11:03:43 CST
Thinker said ..
to pan,
thanks for your comments. I am a lazy boy that only test my system under firefox. In original, I don't want to provide comment system. But, one day, I have a idea of anti-spam for blog comments with crytograph theogry and make a demo system. This comment sys is the demo, I don't make it elegant. But, you are right, I should not give people a unfinished function. I will fix these problems.