What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » XMLHTTP Not Loading After Save

XMLHTTP Not Loading After Save
Author: Message:
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
36 / Male / Flag
Joined: Jul 2003
O.P. XMLHTTP Not Loading After Save
Why is it ,when I use ActiveXObject("Microsoft.XMLHTTP") in my script, if I modify my script then save it, nothing will load.. Do I have to unregister it on uninitalize or something?
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-01-2008 01:04 AM
Profile E-Mail PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: XMLHTTP Not Loading After Save
what does it say in the debugging window?
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
02-01-2008 01:06 AM
Profile PM Web Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: XMLHTTP Not Loading After Save
quick answer:
code:
var XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");

you are possibly forgetting to make a "new" object

what you are saying in your post is this:
code:
var XMLHTTP = ActiveXObject("Microsoft.XMLHTTP");
that code will make you [Image: throwpc.gif]

This post was edited on 02-01-2008 at 01:14 AM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
02-01-2008 01:11 AM
Profile PM Web Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
36 / Male / Flag
Joined: Jul 2003
O.P. RE: XMLHTTP Not Loading After Save
I am using new... Ill go see what debuging window says.

xmlhttp isnt null, but its an empty string. Odd.. Should it be an int or something? Actualy, it was blank from the first time I used it..

What else should I trace out, all I really know is that "xmlhttp.onreadystatechange = function()" isnt triggering after it works for the first time.

I should probably just include all my code..

code:
function updateChat()
{
   var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   Debug.Trace("xmlhttp : "+xmlhttp);
   if (xmlhttp == null) Debug.Trace("Null");
   xmlhttp.open("GET", "http://www.darksignsonline.com/chatlog-light.php", false);
   xmlhttp.send("");
   xmlhttp.onreadystatechange = function()
      {
         Debug.Trace(xmlhttp.readyState);
         if (xmlhttp.readyState == 4 && xmlhttp.status)
         {
            // removed stuff that dosnt matter
         }
      }

}


I have also tried with ASYNC as true, same result. What should it be for my case?

This post was edited on 02-01-2008 at 01:25 AM by bigbob85.
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-01-2008 01:20 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: XMLHTTP Not Loading After Save
You have your xmlhttp.send(""); in the wrong place.

code:
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET", "http://www.darksignsonline.com/chatlog-light.php", true);

xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
      Debug.Trace(xmlhttp.responseText);
  }
}
xmlhttp.send('');
02-01-2008 05:37 AM
Profile E-Mail PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
36 / Male / Flag
Joined: Jul 2003
O.P. RE: XMLHTTP Not Loading After Save
oh wow.. yeh.. that works.
I can see why it works, but any idea why it works? (as in, technical terms) ?
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-01-2008 05:58 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: XMLHTTP Not Loading After Save
Because the object has no function defined if you use the .send command prior to declaring the function.
02-01-2008 12:05 PM
Profile E-Mail PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
36 / Male / Flag
Joined: Jul 2003
O.P. RE: XMLHTTP Not Loading After Save
Yeah, but it'll work the first time around. :S
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-04-2008 12:49 AM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: XMLHTTP Not Loading After Save
It's just a matter of speed. (brb)

You need to use the .onreadystatechange function when you start an asynchronous XMLHTTP request, that's what the third parameter of the .open method means: asynchronous or not. When the .send() method is called, the XMLHTTP starts in another thread and will asynchronously process the request. Meanwhile, your script will continue as well. That means that, after the call to .send(), the script will try to assign the .onreadystatechange function. If the download is still busy, it will work. However, if the download is already done after you assign the .onreadystatechange function, XMLHTTP won't call your function any more, since it has already completed.

When you assign the .onreadystatechange function before you call .send(), you can be assured that the process will find your .onreadystatechange function. ;)

This post was edited on 02-04-2008 at 09:04 AM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
02-04-2008 09:02 AM
Profile E-Mail PM Web Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
36 / Male / Flag
Joined: Jul 2003
O.P. RE: XMLHTTP Not Loading After Save
Ohh.. Ok, thanks :D
[Image: signature-user=16&back=2&clr=0,0,0&size=100.png]
02-04-2008 12:49 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


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