0

I'm trying to implement a search for my project , but i can't figure it out how to use ajax and get data to the view, can some one help me with this?

(this is my first project using codeignter and jquery)

regards, Rangana

2 Answers 2

4

Here's a quick overview:

  1. You need to create an input box (obviously).
  2. On your js file, you give that input an event (keypress or anything you want) and when the event triggered you send an ajax post request to your controller method.
  3. On your controller method you read the post request, then do a DB search, you return the result to your js by 'echoing' the DB search result using your preferred format (JSON, xml, etc).
  4. You process the result on your js file using callback.
Sign up to request clarification or add additional context in comments.

1 Comment

sir can you have any example of it... or may be link of it something.?? @leonardys
0

enter image description here

codeigniter and jquery are unbeatable

see if this can help ...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.