Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am calling a page method from JQUERY which is working fine in Chrome and Firefox however it doesn't work in Safari, can anyone please help?

JavaScript
function setVariables(city, area, date, pooja, isInstant) {
    
    $.ajax({
        type: "POST",
        url: "Default.aspx/setVariables",
        data: "{city: '" + city + "',area:'" + area + "',date: '" + date + "', pooja: '" + pooja + "',isInstant:' " + isInstant + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: OnsetVariablesSuccess,
        failure: function (response) {
           
        }
    });
}

function OnsetVariablesSuccess(response) {

   
    if (response.d == 1) {
      
    }


}
Posted
Updated 16-Mar-15 9:43am
v3
Comments
Sergey Alexandrovich Kryukov 16-Mar-15 15:45pm    
Which page method do you mean, where is it? What happens? Why response should be == 1?
Also, please click "Improve question" to see how to format code samples (I've done this for your this time, next time do it yourself.)
—SA
nikhil choudhry 16-Mar-15 16:46pm    
I have a default.aspx page where I have a button which is calling this function.
It doesn't even go to server side or come back to JQuery success or failure events
<button >
Continue</button>
Kornfeld Eliyahu Peter 16-Mar-15 15:48pm    
Do you have any error?
nikhil choudhry 16-Mar-15 16:44pm    
No, It doesn't do anything. I have a HTML5 button and I am calling this function on click event
<button >
Continue</button>
Modi Mayank 17-Mar-15 0:15am    
Where you defined the event? Show your html code as well. It is not working in Safari only? What about other browsers?

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