开发者

Delivering Javascript Files Securely When Using HTTPS

My asp.net mvc application runs under https and it is working just fine. The problem is when a user goes to the secure portion of the website they get the warning asking them if they want to view only to content that was delivered securely. If they click yes, then non on the javascript or jquery will work. If they select no, then it all works just fine. How then can I provide the .js f开发者_StackOverflow社区iles securely? Or is that totally up to the user? Also the warning gets very annoying at it shows it on every new page that is navigated to. thanks! also, this is only a problem when the user is using IE, Firefox has no issues


twal,

use the following approach and it should fix the issue:

<script type="text/javascript" src="<%= Url.Content("~/Scripts/jqGrid/js/jquery.jqGrid.min.js") %>"></script>

this will then use the approriate path to the file resolving the protocol on it's way.


Make sure you're referencing HTTPS for full URL.

You can often avoid this if they are relative URL as it will normally use the same protocol you are currently on.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜