This project is read-only.

yet, another javascript question (issue)

Topics: Developer Forum, Localization Forum, Project Management Forum, User Forum
Feb 15, 2008 at 10:55 PM
I have a small .js file I tried to include in the site.master file using <script language="javascript" src="functions.js"></script>. I put the file in the root of the webapp.
When I am logged in, the javascript works fine, if I log out, close the browser, reopen the browser and navigate back to the page I was working with, the javascript doesn't work.

I also tried putting the javascript file in the App_Themes directory for the current theme, but that didn't work eiher.
Any suggestions will be greatly appreciated.

Feb 16, 2008 at 7:51 AM
Include javascript as usual. <script type="text/javascript" src="/scripts/scriptfile.js"></script>
And you put your scriptfile i folder "scripts". Add a slash to the url to correct path to file. This shouldn't be any problem.
Feb 18, 2008 at 4:47 PM
Does the "scripts" folder go in the root, or the current theme?
Feb 18, 2008 at 5:02 PM

Thanks for the suggestion. This didn't work either. I tried putting the scripts folder in the root, as well as the theme's root.
If you were testing this yourself, don't forget to (after adding the script referrence) close the browser, reopen and navigate back to the page that in question (while logged out).
YOu'll find that the script only works when logged in.

I now beleieve this to be a bug, and not the intended behaviour. I'll have wade through the code to see why this is happening.