views:

77

answers:

1

I'm coding up a small Vista/7 sidebar gadget for our web based employee schedule system and I've run into a Javascript problem that my Google-FU can't solve. I can't figure out how to fill in a login form from the client.

I'm creating a new ActiveXObject, navigating to the site, but lost as to where to go from here.

var conn = new ActiveXObject("Microsoft.XMLHTTP");
conn.open("POST", "url", false);
conn.send(null);

Can access the form from the ActiveXObject based on the form id? I'd also assume I'm going to need to change a few headers for a POST vs. a GET?

Thanks for any tips or links to references! I can't seem to find much and JavaScript isn't my forte.

A: 

"Navigating to a site" is something a browser does, if that is really what you want, you don't want the XMLHTTP-object, but rather a browser enging. (IE is exposed as COM.)

If posting something to a URL is what you want, you are on the right track. What you need to do is to actually send the data (e.g. form) instead of null. I'd recommend getting Fiddler (Google it) and monitoring the call from a regular browser. I also hear Firebug works just as well. Using either of these tools, you can see what your browser sends to the server, copy and send that instead of null.

svinto