2

So here's the thing am trying to do: I have a textfield and am writing things inside of it.

Using ajax am able to change the content of a div, by setting its content to whatever there is in the textfield.

However the problem is that am using the onChange event of the textfield! Is there a way to make the div content change automatically (in real-time) rather than using the onChange event?

2
  • Have you thought how will the div know when it has to get updated ? Commented May 11, 2013 at 7:44
  • 1
    You're not using Ajax, but javascript. Ajax is the techniques for asynchronously exchanging data with a server. Commented May 11, 2013 at 7:55

2 Answers 2

2

Use the onkeydown event instead.

Sign up to request clarification or add additional context in comments.

Comments

-1

Don't do a lot of dependency tracking yourself if you have more than one instance of such stuff.

Have a look http://knockoutjs.com/. It will do it for you, although I would use it if i had more than one places where i could use that.

You could also look at Angularjs and Emberjs - for other features. (HandlerbarsJS might also have some dependency tracking - but i m not sure of that)

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.