how to use AJAX in CI |
[eluser]Sumon[/eluser]
I like to use AJAX to get State using Zipcode. Here is my controller Code: class Test extends Controller Code: function CreateNewHttpObject() //Create an Instance of HTTP request. My code first create HttpObject which works fine in many other projects (not using CI). After that it calls my test controller's StateByZip($ZipCode) funciton. Upto this point it works fine but after that i feel, my code can't call and execute StateByZip($ZipCode) funciton and as such can't display state value in state box. Please help me resolve it. Or at least send me an example "how to use CI with AJAX". Thanks in Advance.
[eluser]Dr.Dan[/eluser]
Code: var dataSource = "<?=base_url?>test/StateByZip("+ZipCode+")"; You are missing () for base_url() function. By the way....you can post this thread in "Code and Application Development" as this forum is only for Ignited Code[/code]
[eluser]xwero[/eluser]
You have to remove the base_url all together because there is a same domain protection build in the xmlhttprequest object.
[eluser]Sumon[/eluser]
Ok i post it in http://ellislab.com/forums/viewthread/80192/ Please ignore this post. |
Welcome Guest, Not a member yet? Register Sign In |