![]() Preserved Topic: Changing script source (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: London, UK |
![]() Ok, I haven't much experience in mozilla (or any browser apart from IE), so maybe someone could help me out here. code: <script id="varscript" language="JavaScript" src="script1.js"></script>
code: // In script1.js
code: // In script2.js
code: document.getElementById("varscript").setAttribute("src", "script2.js"); amongst other attempts in mozilla, and while it appears that the src is changed, the function does not become redefined and the script doesn't run. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Ironicly I was just reading about this on DHTMLcentral He uses this technique for dynamically changing data with out using an iframe buffer. |
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() Or simply like this: code: <SCRIPT LANGUAGE="JavaScript">
|
Bipolar (III) Inmate From: London, UK |
![]() Thanks bitdamaged - you're a saint! This is exactly what I needed (and for the same reasons). |
Bipolar (III) Inmate From: Berlin (almost) |
![]() stinx: bitdamaged's code won't work in Netscape 4.x because it uses DOM funtions which NN 4 doesn't know. |
Paranoid (IV) Inmate From: Dublin, Ireland |
![]() I use that method aswell ( document.write(js source file) )with big scripts, what I do is I have function like moveXY() sizeXY() and other things. Each different depending if its IE or gecko (screw NS4, he he or at least with my webpage anyway, the document.write function works in ns, and nothing on my page wont work with NS except some opacity stuff, but Im just that extra bit lazy). |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Woah, you can do that? Just create a script node/element, and the browser loads the script? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() yeppers cool eh? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() (Remembering, of course, that it would be completely innaccessible to anyone with javascript turned off.) |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() stupid neandrathals |