| |
| |
| |
|
Page: 1 2
Comments:
<0> when making portlets <1> oh... I don't know BEA Webthing... <0> I'm just asking about javascript in general <1> ok <1> so <0> how to run a function when the page loads <2> You don't need to be able to alter the html to run js. <0> ok great <2> As long as you get to run the script. <1> window.onload = function(e) { some_function(); } <0> pilum, so how? <0> great! I'll try it
<0> it works!! thanks a lot <0> this saved hours of my time.. <1> (but take care to not override an existing "window.onload" function...) <0> oh <0> that one overrides it? <1> check if window.onload is already a function <0> there's already some function in the <BODY onLoad="" <1> if (typeof window.onload == 'function') ... else ... <0> will the window.onload = override those? <1> yes <0> ouch <1> * <1> oups <1> function my_onload(e) { //some code on load; }; if (typeof window.onload == 'function') { window.onload = new Function('e', '(' + window.onload.toString() + ')(e); (' + my_onload.toString() + ')(e);'); } else { window.onload = my_onload; } <1> this check if window.onlod is already set, if it is, it append your new onload function to the one already set <0> cool <0> how do I use it? <0> what triggers it I mean? <1> ? <0> window.onload = function my_onload(e) ? <1> no <0> I just paste what you wrote into my page? <1> in this case you may override the one set <0> so how do I do it? :x <0> what will trigger the my_onload(e) ? <1> wait a minute pls <2> my_onload(); <2> Write that in your code. <0> if I have something like <0> <script .. js> <0> function enableDisable(e) { } <0> enableDisable(this); <1> (have you ever use javascript before today ?) <0> </script> <0> how come that won't just run when I load the page? <0> I know Java.. but not javascript :| <2> If you're enabling/disabling something, then it won't run because you can't be sure that the object which you try to enable/disable exists before window.onload is triggered. <0> ah ok <0> that makes sense <0> hey <0> Locus, the code you gave me seems to work :) <0> thanks! <1> sure it works ! <1> :)
<0> how about browser compability? :z <1> all compatible <0> cool <2> Want to bet? :-P <1> lol <0> :> <3> hm, sorry i don'T get it <2> Heh. <4> furtive: http://www.boingboing.net/2006/01/16/study_how_canadian_c.html <5> hello all.. I was curious if anyone knows how to set the cursor position in a textbox?? i.e. to the end of a string length.. <4> http://www.faqts.com/knowledge_base/view.phtml/aid/17749/fid/53 <4> it may need to be adjust abit for FF <5> cool.. yu <5> ty <6> i did "<input type="button" onClick='window.open("http://google.com/","_blank","");' value="Go ;)" id="sped" />" , how can i execute onClick from <script></script> ?? <4> put them in another function <4> then onclick="myFunc();" and you can call myFunc() outside too <7> or document.getElementById('sped').click(); but that's ugly <6> thanks furtive <6> ill try ;] <4> didn't work in FF <6> but works in IE <6> Opera didnt work <6> so IE is total crap <6> :D <4> i think .onclick() work too. but even uglier <4> now you bash something that work in IE? <6> :) <6> haha <6> :D <6> i made somehting good <6> for one guy in school <6> somebody else will enter that websites url <6> and there will be gay porn <4> you *think* you make something good <6> ;D <6> and they cant close <6> because javascript alerts keep coming up <6> :D <7> dumb even <4> heh <7> first ban of the new year! <8> hello <7> howdy <8> dudes i want to make a button that can copy a text from a page streit to notepad <7> good luck with that <9> :D <4> you can copy the text but nothing you can do with notepad, and if you want to copy the whole page, text will be kind of screw up <4> and good luck <8> hehe thanks
Return to
#javascript or Go to some related
logs:
#MissKitten #java pesth and buda facey-wacey enlyt.com
programe de flood #linux kiku pornstars #chatzone window.onblur firefox
|
|