Welcome Guest, Not a member yet? Register   Sign In
omg javascript and ajax
#1

[eluser]James Pax[/eluser]
Guys I'm using jQuery but I guess it is the same as using plane javascript in this case,

I can't get to post to a php page through www.website.com/index.php/controller as I would do normally on a "view" file with a form.

I think I get an error saying it cannot find the location of the php file I would get with that address?? guys please I need some help I don't wanna go out of the MCV style that CI uses :down:
#2

[eluser]Chris Newton[/eluser]
Can you post some of your code?
#3

[eluser]Derek Allard[/eluser]
You can take a look at how others have used js libraries.

http://video.derekallard.com
http://www.bambooinvoice.org
#4

[eluser]Crimp[/eluser]
If you use ajax in jQuery, I believe the default method is GET. Debug your requests and responses. Search the forum for answers on how to use GET with CI. I prefer to parse the query string and create an array of the variables.
#5

[eluser]maadmac[/eluser]
[quote author="darksky0" date="1195961968"]Guys I'm using jQuery but I guess it is the same as using plane javascript in this case,

I can't get to post to a php page through www.website.com/index.php/controller as I would do normally on a "view" file with a form.

I think I get an error saying it cannot find the location of the php file I would get with that address?? guys please I need some help I don't wanna go out of the MCV style that CI uses :down:[/quote]

Actually, your jQuery script won't be routed through the controller: use the actual server address, the same thing that you may have for $base_url.

So instead of ('controller/function') or whatever for your path, specify the full server route like ('/folder/application/views/file.php') or whatever.




Theme © iAndrew 2016 - Forum software by © MyBB