ajax passing value in codeigniter |
[eluser]stv[/eluser]
$.ajax({ type: "POST", async:false, url: "test/aj", data: dataString, success: function(text) { } the echo item is not returning to function(text)
[eluser]CroNiX[/eluser]
use a full url, check in firebug/console to see that the ajax request is being sent to the correct url and also the post data.
[eluser]stv[/eluser]
i am new in codeigniter ,test is class and aj is function ,so i just pass the value to that functon and does not return any thing
[eluser]CroNiX[/eluser]
Which means nothing to your ajax request, since it's javascript and not CI. Again, try using a FULL url (http://yoursite.com/test/aj) or whatever in the ajax request... Use a javascript console in your browser to see the ajax request and check if it's going to the right place.
[eluser]stv[/eluser]
console reply is "NetworkError: 404 Not Found - http://localhost/CodeIgniter_2.1.2/test/aj"
[eluser]alexwenzel[/eluser]
[quote author="stv" date="1349936156"]console reply is "NetworkError: 404 Not Found - http://localhost/CodeIgniter_2.1.2/test/aj" [/quote] Means your ajax request goes to the wrong address or your controller dont respond the way you like. Is the controller itself working proper?
[eluser]stv[/eluser]
controller is working properly but all paths is not working properly, any problem in routes,config
[eluser]alexwenzel[/eluser]
If this is your path "http://localhost/CodeIgniter_2.1.2/test/aj” ... - There could be a problem with special chars in url - There could be a problem with your .htaccess - There could be a problem with your routes.php Just some ideas
[eluser]stv[/eluser]
Problem solved ,any how still have confusion about paths..thnx buddy
[eluser]alexwenzel[/eluser]
http://ellislab.com/codeigniter/user-gui...uting.html |
Welcome Guest, Not a member yet? Register Sign In |