I have a really wierd issue that I'm hoping someone can shed some light on. I am using Jquery to retrieve an Http Response from another website (which I own). Once I receive the DOM, I parse through it in order to get certain information. However, when I try to get the href attribute of a link, IE is adding the local domain to the beginning of the href!
Here is my code:
$.ajax({
type: "POST",
url: "MyPage.aspx/GetWebResponse",
data: "http://myWebSite/pages/AnotherPage.aspx",
contentType: "application/json; charset=utf-8",
dataType: "json",
asynch: false,
success: function(data)
{
var __htmlForMainPage = data.d;
var PageLink = $(__htmlForMainPage).find("a:contains('Get This Link')").attr("href");
}
});
My variable PageLink SHOULD be "/pages/getThisPage.aspx?id=8347". However, it is being returned as "http://myserver/pages/getThisPage.aspx?id=8347".
This is ONLY happening in IE. FireFox is fine. This also is only happening when I put it on the server. When I run it locally, everything works fine, in both IE and FF. But when I put it on the server, FF still works fine, but IE does not.
Has anyone seen this before, or know what's going on here? Any help is greatly appreciated!