Q:

How do I use AJAX/JavaScript in Drupal 6

Normally, I love drupal and generally I do, but I want to know why it makes coding in JavaScript so hard?
You see, I'm porting an existing page with an AJAX user interface into drupal. I would like to keep it AJAX but at the minute I can't see how - I can't even get a simple alert to work!
A quick google search made me find out 2 things. 1) I need help from someone 2) because drupal has a wired  way of handling javascript due to  it being a CMS.
All my script does is add to inputs to a mysql database in the following format, returning an error if the entry is alreading in the database: input1=input2. So if somebody could start me off with JavaScript in drupal; maybe give me a mysql example script (using AJAX), 
i'd be very grateful!
Thanks in advance,
Andy
PS Googling did reveal some example scripts but I had 2 problems with them. 1) I didn't quite get them 2) due to the fact they were for modules. I need to create a page with an AJAX interface on, not a module!

A:

Maybe the solution to your problem IS a module. 
Other than that, the only thing I can think of is: JavaScript is parsed out of your "page node" (I suppose that's what you mean by creating a "page") due to the content-type settings...
One thing you can do is to create a content-type where you can insert plain-text and hence execute javascript, php, whatever... Creating this kind of content-type, of course has security risks, depending on how you use it and who has permissions to use it...
Update
Take a look at this link and see if it helps http://groups.drupal.org/node/41866#comment-114744

