Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Los Angeles

    Ajax - retrieving remote page with GET

    Trying to retrieve a remote page and include it in the current document. Assume it like, toplist java codes or ad network codes. I dont know Ajax or Java much , going through examples, i model something like the following:

    Scenario is calling source.js?id=XX which will output source.php?id=XX
    document.write part is wrong i guess, however i dont know how to output response data in Java, anyone to help me?

    var xmlHttpReq = false;
    var self = this;
    var URL = "";
    URL+= "?id="+escape(id);
    if (window.XMLHttpRequest) {
    self.xmlHttpReq = new XMLHttpRequest();
    else if (window.ActiveXObject) {
    self.xmlHttpReq = new ActiveXObject(\"Microsoft.XMLHTTP\");
    }'GET', URL, true);
    if (self.xmlHttpReq.readyState == 4) {
    document write (self.xmlHttpReq.responseText);

  2. #2
    Join Date
    Aug 2002
    Why not use a framework to do all the dirty work for you? Consider dojo from, get the minimal AJAX build - it'll do exactly what you need. Many things need to be considered, such as browser version, browser limits, etc. Dojo takes care of all of these things for you, and gives you a very nice widget toolset to work with as well.
    circlical - hosting software development
    forums * blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts