I am creating an MVC web app, and I want to load some page content in via AJAX using jQuery.load(). I have this working, but the problem is that I have to pass the ENTIRE URL in, including the http:// part, or it won't work. In other words, a relative URL path is failing.
So, this works:
$('#params').empty().load('http://localhost:58438/home/getsurveydata #params', val);
This fails:
$('#params').empty().load('/home/getsurveydata #params', val);
Every example I see on the web seems to indicate that the second form should work just fine. Any thoughts?
FWIW I tried removing the 'val' part and the #params part, but that made no difference. It doesn't even hit the controller. And like I said, it works in the first format with as written, the URL is the only difference. What am I missing?