hi folks
I use jquery and it gives me error : "Microsoft JScript runtime error: 'url' is null or not an object"
when I use "$.ajax(window.location.href");" inside window.location.href is like this :
"http://localaddress/mypage.aspx?id=2"
How I can solve it ?
views:
12answers:
1
+1
A:
$.ajax()
takes an object with options, like this:
$.ajax({ url: window.location.href });
If you just want to fetch a URL, use $.get()
like this:
$.get(window.location.href);
It's one of the $.ajax()
shorthand methods, if you want to send parameters, it looks like this:
$.get("mypage.aspx", { id: 2 });
//or long-hand
$.ajax({ url: "mypage.aspx", data: { id: 2 }});
Nick Craver
2010-10-30 11:08:31