views:

396

answers:

1

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?

+2  A: 

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.

tpower
You can see what is the browser loading using the Net tab in Firebug.
Eduardo Campañó