ASPX templates
Version 5.x > ASPX templates > Where Do I Put My JavaScript? View modes: 
User avatar
Member
Member
eric.rovtar-hudsonchapel - 6/17/2010 12:55:40 PM
   
Where Do I Put My JavaScript?
Hi!

I'm trying to build a site using ASP .Net MasterPages. I have the page loading correctly, except the JavaScript files don't seem to load (or at least there is no JavaScript execution on my page).

All scripts are kept in "~/CMSTemplates/AuroraChapel/scripts/", and my src attribute is "scripts/Navigation/Navigation.js", so how do I get them to work?

The StyleSheets are stored similarly: "~/CMSTemplates/AuroraChapel/styles/", I link to them with href="styles/MasterPage/Master.css", and they load just fine.

Does anyone have any ideas?

Thanks,
Eric

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/22/2010 3:55:06 AM
   
RE:Where Do I Put My JavaScript?
Hello,

Well, the most reliable way is referring to whole path like this:

~/CMSTemplates/AuroraChapel/scripts/Navigation/Navigation.js

It preserves the virtual directory as well.

Putting this into the src parameter, it should work just fine.

Best regards
Ondrej Vasil