Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Javascript : Filename extract and insert in a src syntax problem


Purple_Martin - 4:44 am on Sep 4, 2002 (gmt 0)


Firstly, doesn't location.pathname have back-slashes instead of forward-slashes? Try lastIndexOf('\')+1

Secondly, when it works, I think you'll get the following URL in your src attribute (note the unwanted ".htm"):
[abc.com...]

Thirdly, get rid of the HTML comments (I heard somewhere that some browsers don't like them): <!-- and //-->

HTH


Thread source:: http://www.webmasterworld.com/javascript/184.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com