I have a bookmarklet that when clicked opens up a div popup on their current page(e.g. www.cnn.com). This div has a button that that when clicked makes a jQuery.get request to my application domain. This is all working fine, but I am getting an error on the response. This is the function that makes the request
function postWishXML(){
jQuery(".ServerResponse").ajaxError(function(event, XMLHttpRequest, ajaxOptions){
//entering here
});
var Wish = wishObject();
if(Wish == false)
{
jQuery('.ServerResponse').html('Please enter a gift title');
jQuery('.GiftText').val('');
}else
{
jQuery('.ServerResponse').html('');
var WishXML = createXMLTags(Wish);
jQuery.get(Root+'/apps/shop/toolbar/WishlistPopup.ashx',
{'sap':Cookie,'wish':WishXML},
Response,
'text'
);
}
}
this is the server code
public void ProcessRequest (HttpContext context) {
if (SecurityContext.IsAuthenticated || SecurityContext.IsSemiAuthenticated)
{
if (!string.IsNullOrEmpty(context.Request["wish"]))
{
string res = "Your wish has been added";
context.Response.ContentType = "text/plain";
context.Response.Write(res);
context.Response.End();
}
}
Is my problem something to do with cross domain scripting or syntax?
Thanks