Forum Moderators: open
[codes]
RewriteEngine On
RewriteBase /yt
RewriteRule ^listing/([^/]*)/([^/]*) \
listing.html [PT]
[/codes]
the purpose of rule is that if someone access url site.com/listing/foo/bar then it always access listing.html file.
Now it works fine. The problem arose when I tried to call a function on onload() event of listing.html. I am always getting "function blah()" not found. Later when I tried to access url as site.com/listing.html then it fired the event and loaded function "blah".
Now I have to use particular URL pattern anyway, please tell me how do I tackle this JS error?
Thanks
Use the absolute uri
<script type="text/javascript" src="http://www.example.com/foo.js"/>, or just the absolute path
<script type="text/javascript" src="/foo.js"/>when referencing files on your website.
Choose one of the suggestion from my earlier post, that will fix things up, or check out the Apache Web Server [webmasterworld.com] forum, for similar problems (broken images and malfunctioning javascript when rewriting requests).