Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Callback to script-tag from included script?


  • From: hakan at backbase.com (Hakan Magnusson (Backbase))
  • Subject: [Javascript] Callback to script-tag from included script?
  • Date: Wed Aug 18 11:13:39 2004

Hi Roger,

Thanks for the input, but document.location is no good. Because this 
script file can be included from anywhere in the site structure, it must 
be able to reference to its "own" location.

This also has to be unique for every HTML-file that includes the file, 
so fixing on a global variable for the (absolute) path, like sMyPath = 
'/blah/js/external.js', is no good either.

If the page is in 'blah/' I need to have 'js/external.js' as the data, 
and if the page is in 'blah/bluh/' I need to have '../js/external.js' as 
the data.

Wicked, eh? :)

Regards,
H