trying to post to a login page with jquery

Events happening in the community are now at Drupal community events on www.drupal.org.
mushi's picture

I am trying to login to another site remotely through jquery. I have set up a link on my site that will run my js file. My question is how do I either redirect my page or open a new browser window that will access the remote login page? The remote login page will accept the username and password as hidden fields. The username and password are being passed into my script from my drupal page.

Would I use the $.post function as shown below (although this doesn't work) or is there another way?

if( Drupal.jsEnabled){
$(document).ready(function(){
$('a.logon_to_abc').click(function(){
var GetData = function( data ){
var result = Drupal.parseJson(data);
$.post("https://www.abc.com/Login.aspx", { UserID: result['UserID'], PWD: result['PWD']},
function (){
alert("works");
} );

  }
  $.get(this.href, null, GetData );
return false;
});

});
}

Thanks..

Javascript

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: