Welcome Guest, Not a member yet? Register   Sign In
Enable GET for just one controller / Auto Complete?
#1

[eluser]Unknown[/eluser]
Hi there, I'm trying to write a server side controller for autocomplete data. I have the following stumbling block and that is jQuery only allows input via a GET method. I've searched the forums/google and have noticed I can edit one of the core files and change this to a POST event.

However I intend on using the google-api script link so that jQuery is faster for the end user to download. This means I can't modify it. I will change this if I HAVE to but I'd rather not.

I'm thinking it may be easier to enable GET for just one controller to handle all the Autocomplete requests. If so How do I do this?


Are there any other solutions to this or would I just have to not use the googleapi hosted version of jQuery?
#2

[eluser]eoinmcg[/eluser]
i'm assuming that you're using the jquery $.ajax() function?

in which case you can do something like
Code:
$.ajax({ url: "/controller/method", type: "POST", ...etc

alternatively, if you really want $_GET have a look at this: http://stackoverflow.com/questions/20430...odeigniter
#3

[eluser]Victor Michnowicz[/eluser]
CodeIgniter Reactor also has GET support on by default. It also includes an is_ajax_request() method (which may come in handy for your app).




Theme © iAndrew 2016 - Forum software by © MyBB