new XMLHttpRequest??

Discussion in 'JavaScript' started by t3od0r, Apr 6, 2010.

  1. #1
    Hello, i am trying to make a windows 7 gadget and i am trying to login to a site. How can i do this with javascript?
    i have this to get the content of a page where login is not required.
                http = new XMLHttpRequest();
                http.onreadystatechange = showNews;
                http.open("GET", 'http://www.website.com/file.php');
                http.send(null);
    Code (markup):
    how can i edit it to work on pages where i need to login?

    thanks.
     
    t3od0r, Apr 6, 2010 IP
  2. ps3ubo

    ps3ubo Peon

    Messages:
    204
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you cant use javascript to open external websites - can you? ^o)
     
    ps3ubo, Apr 7, 2010 IP
  3. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I would say to keep compatibility over browsers use Jquery's $.ajax function to retrieve the sites content and do what you need with it. very flexible
     
    atlantaazfinest, Apr 7, 2010 IP
  4. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #4
    sigh, he's sandboxed behind the widgets api, what jquery? cross site requests should not be an issue here. as for auth, just append user/pass as get parameters, unless it's htaccess, in which case user:pass@url
     
    dimitar christoff, Apr 8, 2010 IP