Jump to content

Ajax to always pull and display data??


DeanWhitehouse

Recommended Posts

I have just started to learn AJAX and i am making a chatroom the problem i am having is on how to pull data from the php file and display the data inside another page, and how to show current data, as it will continuosly be changing. Any one know how to do this, the most i have been able to do so far is display data inside a input field from a php file.

Link to comment
Share on other sites

Use the "innerHTML" property for DIV, SPAN, and similar layout elements.

 

Use the "value" property for INPUT, TEXTAREA, and similar form elements.

 

Use events to specify when AJAX should be requested. The event verbiage "onClick", "onLoad", and "onMouseOver" is very easy to understand.

 

I've created a simple Base64 encoder and attached it to this post. You can see that when a user enters a string and clicks the "encode" button, the encoded string is displayed. I used the "onClick" attribute to make this work.

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.