Forum Moderators: open

Message Too Old, No Replies

Calling a .js file from another .js file

Calling a .js file from another .js file

         

mavrick

2:07 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



Hi all

Something I need help on.

I have several .js file and I was wondering if it was possible if I could call all of them with just one .js file.

e.g. 1.js has to call 1.1.js and 1.2.js.

I did some research and found this bit of code, but it did not work for me...

Code:

document.write("<SCR" + "IPT LANGUAGE=3D'JavaScript1.2'
SRC=3D'p7pm/1.1.js' TYPE=3D'text/javascript'><\/SCR" + "IPT>");

This bit of code has to go into the 1.js file and the 1.js file has to be referenced from a web page.

Please could you guys help...
Been sitting on this for a while.

Thanks in advance

Bernard Marx

3:17 pm on Apr 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



document.write(
'<scr' + 'ipt type="text\/javascript" src="p7pm\/1.1.js"><\/script>'
+'<scr' + 'ipt type="text\/javascript" src="p7pm\/blah.js"><\/script>'
);

mavrick

7:14 am on Apr 29, 2005 (gmt 0)

10+ Year Member



Thanks alot

Code works great.