943,152 Members | Top Members by Rank

Ad:
Mar 21st, 2010
0

JavaScript/AJAX function is not defined??

Expand Post »
Hey! I am making a chat program. I have a function Chat();

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. function Chat(){
  2. var fullMessage = document.getElementById('name').innerHTML +' '+ document.getElementById('message').value+'\n';
  3. fullMessage = fullMessage.replace(/\\'/g,"'");
  4. fullMessage = fullMessage.replace(/\\"/g,""");
  5. fullMessage = fullMessage.replace(/\[/g,'*lsb?');
  6. fullMessage = fullMessage.replace(/\]/g,'*rsb?');
  7. sendRequest('http://3rlend.com/pjattappend.php','F=allMessages.txt&D='+'fullMessage','POST',true);
  8. document.getElementById('message').value="";
  9. }
sendRequest(url,params,method,Asynch); i an AJAX function.

Now when I try to execute Chat();, there comes an error in FireBug; Chat is not defined! But Chat is defined!
And when I try to execute Chat(); in the address line by writing javascript:Chat(); , then this error comes:
Chat is not defined (204 out of range 90) Chat is not defined
What does this error mean?

You can test it here: http://3rlend.com/pjatt/ .
You need to sign in to test it, so usernamepassword:
[B]Tester[B]testing
Then the script is loaded.

EDIT:
I found out that every single function that is written after function HandleRequest(Data,url); is not defined!

EDIT2: Found the problem after counting the bracets!
Last edited by ErlendHL; Mar 21st, 2010 at 7:38 am. Reason: Found out!
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
ErlendHL is offline Offline
58 posts
since Feb 2010
Mar 27th, 2010
0
Re: JavaScript/AJAX function is not defined??
Cnet used to do a better job keeping adware/spyware out. Now they seem to be letting people in under the radar. I'm talking about companies with dozens of products loaded with spyware. I don't think that is going to be a good thing down the road as far as consumer confidence. Just my $0.02
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sunsetrainbow is offline Offline
10 posts
since Mar 2010
Mar 27th, 2010
0
Re: JavaScript/AJAX function is not defined??
Cnet used to do a better job keeping adware/spyware out. Now they seem to be letting people in under the radar. I'm talking about companies with dozens of products loaded with spyware. I don't think that is going to be a good thing down the road as far as consumer confidence. Just my $0.02
Dude, that was totally off-topic!
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
ErlendHL is offline Offline
58 posts
since Feb 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Changing an independent image when rolling over a link
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: input data disappeared after the apply button is clicked





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC