开发者

ASP.NET: Using head.js in Master Page, ResolveUrl [closed]

开发者 https://www.devze.com 2023-02-04 11:10 出处:网络
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.

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 question

I'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.

0

精彩评论

暂无评论...
验证码 换一张
取 消