Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have java script function in which i made jquery ajax call to my web services for retrive data. This function work well with browser IE9 but throw an error on other browser(chrome, opera) including IE10 also.

JavaScript
function DataRequest()
{
     
      $.ajax({ type: "POST",
                url: Wurl,
                data: bhrequest,
                timeout: 10000,
                contentType: "text/xml",
                datatype: "xml",
                beforeSend: function (xhr) {
                    xhr.setRequestHeader("SOAPAction", "http://www.demo.com/Webservice");
                },
                success: function(result, status){
                    OnCompleteCustomer(result);
                },
                error: function (xhr, status, error) {
                    alert(error);
                }
            });
}


Here Wurl is the url of services. bhrequest is data parameters send to services and OnCompleteCustomer is method calling after successful.
but it's gone on error and thrown above mansion mentioned error.

Above error solve by don't setting datatype for response. data type parameter leave blank

I debug my code and got the result,that it's get result string in result argument of success function on IE9 browser.
But in Chrome the result string is blank.
Please tell me what is the reason behind it.
Posted
Updated 29-Nov-13 2:59am
v7
Comments
ZurdoDev 26-Nov-13 7:38am    
Is it calling the service? I don't see the code that is actually causing that error.
N_cooL 27-Nov-13 0:12am    
Yes, It is calling services.
ZurdoDev 27-Nov-13 7:14am    
So is the error being thrown in the service? You need to narrow it down for us.
N_cooL 27-Nov-13 8:01am    
No, services working well and as i mansion before same code working well with IE9.
ZurdoDev 27-Nov-13 8:09am    
So, which line of code is causing the error?

1 solution

Ok, What do you get in bhrequest variable?
I think the error is in bhrequest variable.

Try to hard code parameter value to the above mentioned variable and check it.

Otherwise try to update the error throwing code so that we could try to help you out.

Hope this helps you out.

Regards,
RK
 
Share this answer
 
Comments
N_cooL 28-Nov-13 5:57am    
how bhrequest variable has error. when it's run well on IE9 without any error.
♥…ЯҠ…♥ 28-Nov-13 6:01am    
can you post bhrequest assigning code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900