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


known_x - 4:33 am on Sep 4, 2002 (gmt 0)


This script extracts html name and give it to a src with a js file in an other domain.
There is a syntax problem in this script which I couldnt find:

<script language="JavaScript"><!--
var fileName =location.pathname.substring(location.pathname.lastIndexOf('/')+1);
document.write('<script src="http://www.abc.com/path/'+fileName+'.js"><\/script>');
//--></script>

What is the correct syntax?
Thanks


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