2
Vote

jquery

description

I tried using the jquery javascript library, and I'm getting an "Microsoft JScript runtime error: Object expected" error that I wouldn't normally expect. So far, this is all the script I've added.
 
<script type="text/javascript" src="~/javascript/jquery-1.2.6.min.js"></script>
<script type="text/javascript"> 
       $(document).ready (function () {});
</script>
 
The proper file is at the defined src, and a typical VS 2008 website runs this code on IE 7 with no problems. I've only seen the WCSF have this issue. Is there any reason it should fail inside a WCSF solution?

comments

thorsteinsson wrote Sep 11, 2009 at 5:16 PM

you use ~ in beginning of server side urls only.
fix:
<script type="text/javascript" src="<%=ResolveUrl("~/javascript/jquery-1.2.6.min.js")%>"></script>