Link to home
Create AccountLog in
Avatar of everycloud
everycloudFlag for United Kingdom of Great Britain and Northern Ireland

asked on

jsonp cross domain request not called

I am trying to make a cross domain request in an aspx page to return some xml data.

I am using the following script

function getTotalNumberofPages() {
	
var result = -1;
var url = path + 'GetPageCount.ashx?' + 'templateId=' + sTemplateID + '&query=' + encodeURIComponent('<%=sqlstatement%>') + '&conn=' + encodeURIComponent(connectionString);

$.support.cors=true
$.ajax({
	url: url,
	type: "GET",
	dataType: "jsonp xml",
                  jsonpCallback:'PagesCallback',				
	success: function ( xml )
		{
			xml = textToXML(xml)
			var pages = $j( xml ).find( "Size" ).text();
			result = parseInt(pages);
		},
	error: function (jqXHR, textStatus, errorThrown) {
			alert("Error: GetPageCount " + errorThrown.message + "\n" + errorThrown.description + "\n" + jqXHR.responseText);
			result = -1;
		}			
	});
		return result;
}

Open in new window


Whenever the function gets called I receive the error:

PagesCallback was not called.


I don't know why this error is occurring or what action to take to resolve this.

A google search has not proved very fruitful either.

I may resort to some voodoo but thought best to try the scientific approach before any chickens have to die.

Any help would be much appreciated by myself and most definitely by the chickens.

SAVE A CHICKEN peeps!
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Seems you might need

crossDomain:true,


http://api.jquery.com/jQuery.ajax/
Avatar of everycloud

ASKER

Sorry that hasn't worked.  I still get the same error.
ASKER CERTIFIED SOLUTION
Avatar of everycloud
everycloud
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Closing the question as no solution was found and the question is out of date now.