Click here to Skip to main content
16,015,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have used this code for posting url and got the result but error method is call instead of Success.
can you please help me?

PHP
$.ajax({
      type: 'GET',
      url: SendUrl,
      data: 'Message+=',
      success: function (resp) {
          alert(resp);
      },
      error: function (e) {
          alert('Error: ' + e);
      }

  });
Posted
Updated 16-Jul-15 20:12pm
v2
Comments
F-ES Sitecore 17-Jul-15 3:13am    
Use the browser's dev tools (f12) to look at the network traffic when you make the call, that might help you see what is happening and will show any errors that might be thrown.
Mohibur Rashid 17-Jul-15 3:27am    
Your data is wrong. Try to get more detailed error.
Jigs IT 17-Jul-15 4:50am    
so what actually i put in data ?
Mohibur Rashid 17-Jul-15 4:57am    
Formatted URI; as example Message=I am Jigs ; the formatted URI would be
data:'Message=I%20am%20Jigs'

1 solution

See http://api.jquery.com/jQuery.ajax/[^] for the proper error function. Your error function can accept these parameters:
JavaScript
error: function(jqXHR jqXHR, String textStatus, String errorThrown)

Then analyze jqXHR.responseText. That will give you the error.
 
Share this answer
 

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