Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 07-04-2007, 07:11 AM   #1 (permalink)
 
Newb Techie

Join Date: Jun 2007

Posts: 3

dropper is on a distinguished road

Default Javascript

Big thing I am working on, help me get started

Well, I want to make a thing with PHP and AJAX/Javascript that updates a TEXTAREA box each time the database is changed.

Whats more, I need the textarea to be able to have colored text inside of it,

or make it somewhat like a textarea appearance, maybe a DIV? It cannot be written inside of.

Can somebody show me a tutorial?
dropper is offline  
Old 07-09-2007, 03:39 PM   #2 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Javascript

I don't know of any specific tutorials, but I'd work on simply understanding the basics of AJAX... w3c's tutorial/intro, for example.

The text area (or any other visible HTML object) appearance can be controlled completely by CSS.

I recently wrote a simple "post" with it, which you can see/use on my website, and with that, if you view the source, you can see everything that goes on.

An excellent utility to have when working with any Javascript is a Firefox plugin, FireBug. It lets you see every javascript request, including the http requests/return values... I couldn't have found some simple bugs without its help.

As for updating whenever the database is changed, with my "post", what I have it do is:
1. When the server script is called, it checks the timestamp and if there have been changes, return the last X messages.
2. It returns a "change" value each time (0/1), so I know to update the fields if there has been an update (1), and to save a little bandwidth (by not sending the list of messages each time).

Of course it's just a start, but quite a bit of fun!

If you have any specific questions/issues with it though, do ask!

PS: One issue that took me hours to figure out, when using the javascript xml parser, remember that the server-side script needs to return the content-type of XML. I didn't do that, so the javascript always saw it as a null object.
__________________
Vormund is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX ... Javascript - XMLHttp Objects - Getting the XML responses... Vormund Programming Discussions 4 06-18-2007 01:21 AM
quick javascript help joe33 Programming Discussions 1 05-15-2007 04:29 PM
NEED help with a Javascript code...(mouseover and stuff) Quintox Web Graphics, Design, Digital Images 7 05-02-2007 06:41 PM
Debugging Javascript Application Using Date Method Cunjo Programming Discussions 1 04-17-2007 11:07 PM
JavaScript Botnet Code Leaked To Internet Osiris Virus - Spyware Protection / Detection 0 04-02-2007 09:05 PM