What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » AJAX isn't working

AJAX isn't working
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: AJAX isn't working
quote:
Originally posted by The-Phantom
Yeah, I know about that error of mine. But can't it be like this?
js code:
function OnEvent_ChatWndSendMessage(Wnd, Message)
{
    if(Message.substr(0, 10) != "/ajax-test")
        return Message;
    // handling for /ajax-test
}

No...
1) nothing will be executed after the return statement
2) when you return the same message, the command will be send to your contact too (as text).
3) in that code you check if the message is _not_ "/ajax-test", it should be the opposite. You should never ever do != or !== to check for a command!! Again, this will cripple the proper workings of command handling... Always do a positive test, never a negative, for this.

See the code in my previous post for the proper way.

quote:
Originally posted by The-Phantom
Also, I know that I can do the same with an asynchronous request and sending another message, but what about receiving messages, where I need to change the text I receive? There's no function to "receive" another command, as far as I am aware…
There are some things you need to know whenyou want to change recieved text.

Biggest thing is that you can never change recieved text to text which is longer than the original.

Second, text you receive also includes your own send messages.

See OnEvent_ChatWndReceiveMessage event.

All this is also explained in the Plus! Scripting documents.

;)

This post was edited on 08-30-2010 at 08:35 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-30-2010 08:31 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
AJAX isn't working - by The-Phantom on 08-28-2010 at 01:33 PM
RE: AJAX isn't working - by V@no on 08-29-2010 at 05:31 AM
RE: AJAX isn't working - by The-Phantom on 08-29-2010 at 07:09 AM
RE: AJAX isn't working - by Matti on 08-29-2010 at 07:10 PM
RE: AJAX isn't working - by The-Phantom on 08-29-2010 at 07:57 PM
RE: AJAX isn't working - by CookieRevised on 08-29-2010 at 08:24 PM
RE: AJAX isn't working - by Matti on 08-29-2010 at 08:43 PM
RE: AJAX isn't working - by The-Phantom on 08-30-2010 at 06:48 AM
RE: AJAX isn't working - by CookieRevised on 08-30-2010 at 08:31 AM
RE: RE: AJAX isn't working - by The-Phantom on 08-30-2010 at 08:40 AM
RE: RE: RE: AJAX isn't working - by CookieRevised on 08-30-2010 at 09:01 AM
RE: RE: RE: RE: AJAX isn't working - by The-Phantom on 08-30-2010 at 09:22 AM
RE: AJAX isn't working - by Eljay on 08-30-2010 at 09:41 AM
RE: AJAX isn't working - by CookieRevised on 08-30-2010 at 10:12 AM
RE: AJAX isn't working - by Eljay on 08-30-2010 at 10:35 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On