jQuery $.post and CI |
[eluser]damien66[/eluser]
Hi, I have a problem on my web application with jQuery $.post. My javascript is : Code: $.post("create-account", { name: "John", pass: "test" }, and the Php Code: echo 'data received'; The Php is called and executed but, I can not get the response in my javascript Can you help me ? thanks :)
[eluser]InsiteFX[/eluser]
Search the forums this has been answered a 100 times! CSRF cookie in the config.php file. You have to pass the cookie value to jQuery InsiteFX
[eluser]damien66[/eluser]
I can not find $config['CSRF'] on my config.php file...
[eluser]steelaz[/eluser]
What are your response headers for AJAX request in Firebug?
[eluser]damien66[/eluser]
Quote:Réponsevoir le code source Is it what you need ? On firebug I see the response but javascript can not retrieve it
[eluser]steelaz[/eluser]
Look like you're getting your response back (Content-Length: 122). Try Code: $.post("create-account", { name: "John", pass: "test" }, and check Firebug console for returned variable.
[eluser]damien66[/eluser]
Ok, I have add the console.log and no effect. I put a break point on the console.log and no effect... The function contents isn't executed :O Do you have an idea ?
[eluser]steelaz[/eluser]
Does Firebug report any errors? Try replacing post() with more customizable ajax(): Code: $.ajax({
[eluser]damien66[/eluser]
error completed and the firebug msg is now : "404 Page Not Found</h1> <p>The page you requested was not found."
[eluser]steelaz[/eluser]
Check your request headers and make sure URL is correct, change Code: url: "create-account" |
Welcome Guest, Not a member yet? Register Sign In |