I have a very strange problem in an ASP.NET page, the following reference of JavaScript file works well in IE6
<script src='~/Scripts/xxx.js' type="text/javascript"></script>
But not working in IE7/8, I got object required error when load the page
change to the following works:
<script src='<%# ResolveUrl ("~/Scripts/xxx.js") %>' type="text/javascript"></script>
Can anyone explain? Thanks.
~/ is not going to be anything the browser knows about, it needs to be a relative path or an absolute one. The ResolveUrl method take an asp.net path and creates one the browser can understand.