vote up 1 vote down star

I can successfully include main jquery files in /Scripts, but if my custom test.js file is in Scripts, it will not work:

<script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/jquery-1.2.6.js") %>"></script>
<script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/test.js") %>"></script>

However, when I move my custom test.js file to /js, everything works fine:

<script type="text/javascript" src="<%= this.ResolveClientUrl ("~/Scripts/jquery-1.2.6.js") %>"></script>
<script type="text/javascript" src="<%= this.ResolveClientUrl ("~/js/test.js") %>"></script>

Why is that?

flag

1 Answer

vote up 2 vote down check

You've probably tried this but make sure you clear the client cache when checking things like javascript includes. The client could be holding on to a an old copy of test.js.

Changing the URL will cause it to pick-up the latest again.

link|flag
You can see what is the browser loading using the Net tab in Firebug. – Eduardo Campañó Jan 13 '09 at 10:41

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.