Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to include a <script> call within a JS javascript file???

Status
Not open for further replies.

marcnyc

Technical User
May 31, 2002
3
0
0
US
Ok guys, I have been looking around in the net for the solution and couldn't find it... Then I have been looking around the net for forums and I found this... I really hope you can help me with this... I am a webdesigner not a programmer so I don't know javascript except for very basics...

In my website I include a header with a JS file (header.js). Basically this header.js file contains lots of document.write("content"); lines with my design.
I include the header.js file in my sites with a <script> call like this:
<script language=&quot;javascript&quot; src=&quot;/header.js&quot;></script>

Now I wanna ad a script to my pages (all my pages) so I wanna put it in the header to avoid editing over 100 pages. This script is written in perl and has to be called with a javascript call such as this one:

<script language=&quot;javascript&quot; src=&quot;/cgi-bin/online.pl&quot;></script>

I trid this:
document.write(&quot; currently <script language=\&quot;javascript\&quot; src=\&quot;/cgi-bin/usersonline/online.pl?tag=javascript\&quot;></script> user(s) online&quot;);

and I tried this:
document.write(&quot; currently &quot;);
src=&quot;/cgi-bin/online.pl&quot;>
document.write(&quot; user(s) online&quot;);

and both do NOT work.

Of couse the script works fine when launched from plain html so I know that.

So therefore my question is: how can I put a script call usually called with a <script> call INSIDE a header.js file that is then recalled on all the pages with a <script> call too????

PLEASE HELP ME!!!
THanks in advance!
 
try
Code:
document.write(&quot; currently <scr&quot;+&quot;ipt language=\&quot;javascript\&quot; src=\&quot;/cgi-bin/usersonline/online.pl?tag=javascript\&quot;></scr&quot;+&quot;ipt> user(s) online&quot;);
 
Some versions of AOL's browser seem to choke on this, from complaints I've received where I've tried this. The people did not include AOL version number or any other information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top