Welcome Guest, Not a member yet? Register   Sign In
ajax passing value in codeigniter
#1

[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)
#2

[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.
#3

[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
#4

[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.
#5

[eluser]stv[/eluser]
console reply is "NetworkError: 404 Not Found - http://localhost/CodeIgniter_2.1.2/test/aj"
#6

[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?
#7

[eluser]stv[/eluser]
controller is working properly but all paths is not working properly, any problem in routes,config
#8

[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


#9

[eluser]stv[/eluser]
Problem solved ,any how still have confusion about paths..thnx buddy
#10

[eluser]alexwenzel[/eluser]
http://ellislab.com/codeigniter/user-gui...uting.html




Theme © iAndrew 2016 - Forum software by © MyBB