CodeIgniter Forums
Jquery ajax request works in some pages and in others it doesnt - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Jquery ajax request works in some pages and in others it doesnt (/showthread.php?tid=52820)

Pages: 1 2 3


Jquery ajax request works in some pages and in others it doesnt - El Forum - 06-28-2012

[eluser]iceuser[/eluser]
[quote author="Matalina" date="1340919940"]1. Do you have crsf protection enabled?
2. I could be wrong, but crsf protection doesn't work with get statements as get's are typically in the url (though I could be wrong)

Are you posting a form? or just using post as an ajax call to do something?[/quote]

right now csrf is disabled

i am just posting into the controller function, there is no form here


Jquery ajax request works in some pages and in others it doesnt - El Forum - 06-28-2012

[eluser]Matalina[/eluser]
if crsf is disabled and using post with the data removed it should go thru.

if crsf if disabled and you are using get it should go thru.

if crsf is enabled and you are using post you need the crsf token or it won't go thru.

if crsf is enabled and you are using get I don't know if the token is needed or not.




Jquery ajax request works in some pages and in others it doesnt - El Forum - 06-28-2012

[eluser]Matalina[/eluser]
What does your console say after you've done your ajax call.

I've not used firebug in a while but in Chrome it'll show the Post the url it called and display an error that it gave me.


Jquery ajax request works in some pages and in others it doesnt - El Forum - 06-28-2012

[eluser]iceuser[/eluser]
[quote author="Matalina" date="1340920813"]What does your console say after you've done your ajax call.

I've not used firebug in a while but in Chrome it'll show the Post the url it called and display an error that it gave me.[/quote]

the weird thing is that it doesnt return any error at all... the request will simply go on for 5-8 minutes and then die... without sending back anything...


Jquery ajax request works in some pages and in others it doesnt - El Forum - 06-29-2012

[eluser]Matalina[/eluser]
I don't know. Is it reaching your method?


Jquery ajax request works in some pages and in others it doesnt - El Forum - 06-29-2012

[eluser]iceuser[/eluser]
[quote author="Matalina" date="1340975433"]I don't know. Is it reaching your method? [/quote]

i re-installed Lion into my machine and everything is sorted now...


I hope this wont happen soon again... even though i still don't know the reason of the problem...