ASP.NET: Using head.js in Master Page, ResolveUrl [closed]
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this questionI'm trying to use head.js in my master page, and unfortunately -- I can't seem to get the syntax down as I ne开发者_C百科ed to use ResolveUrl.
Here's what I have:
head.js("<%= ResolveUrl("~/js/jquery-1.4.2.min.js") %>","<%=
ResolveUrl("~/js/jquery.jstree.min.js") %>");
Any suggestions? This doesn't work.
By "doesn't work", I mean that the head.js call doesn't recognize the quotations I'm using. It isn't loading the files basically because I have some sort of incorrect syntax that the VS 2010 isn't telling me.
Try using it with the ResolveClientUrl helper instead:
head.js('<%= ResolveClientUrl("~/js/jquery-1.4.2.min.js") %>','<%= ResolveClientUrl("~/js/jquery.jstree.min.js") %>');
I solved it. I had a piece of code loading in the prerender, thus causing an error because the the jQuery file wasn't loading yet.
精彩评论