Ajax help.

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by taekwondokid42, Apr 3, 2009.

  1. taekwondokid42

    taekwondokid42 New Member

    Messages:
    268
    Likes Received:
    0
    Trophy Points:
    0
    Hey. Here is the scenario:

    I am on site A.
    I send GET data to site B.
    I want the response to go to site C.
    But it keeps returning to site A.


    How do I change this?
     
  2. primefalcon

    primefalcon New Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Can you post the code relevant to this please
     
  3. olliepop

    olliepop Member

    Messages:
    138
    Likes Received:
    0
    Trophy Points:
    16
    this is very very very very vague.
    i gave close no idea what you're asking.

    maybe you're refering to POLLING? (capitalised because its a method, im not angry lol)
     
  4. taekwondokid42

    taekwondokid42 New Member

    Messages:
    268
    Likes Received:
    0
    Trophy Points:
    0
    ehh, polling is involved, but not exactly.

    I'm very new to ajax, and I don't really know what I'm talking about. Could you give a list of ajax methods and a brief description of each?
     
  5. blobtech

    blobtech New Member Prime Account

    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    To clarify what AJAX is and how it works:

    AJAX stands for Asynchronous Javascript And XML
    It is a technique in Javascript that allows the programmer to have scripts download and use data from the server, without having to reload the page.

    An XMLHttp Javascript object will hereby function as a browser, it uses the HTTP protocol to request a page, and then the content of that page can be read by Javscript once the request is completed.

    1. User browses to page A with his browser, the browser will request page A from the server.
    2. Server sends page A to browser, which displays it on the users screen. Page A contains Javascript.
    3. Javascript initiates a XMLHttp object and requests a page B (with optional GET or POST data, which can be retrieved from formfields or such)
    4. Server sends page B back to the Javascript XMLHttp object on page A in the browser.
    5. The XMLHttp object will update its readystate, and the Javascript recognizes that the request is complete (or failed).
    6. Javascript reads contents of page B, and (possibly) inserts it into page A in the browser

    That way, the website can still download content from other pages on demand (or download PHP-generated data like a chatmessage), without the user having to wait untill the entire page is downloaded and displayed.

    For a good tutorial on working with AJAX / XMLHttp, please visit w3schools.com/ajax
     
    Last edited: Apr 5, 2009
  6. supermix

    supermix New Member

    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    Ajax I believe has security restrictions. which prevents it to modify anything or send anything to site C.

    but I believe you can combine server side scripting and ajax to accomplish just about any task. Unless you are asking about user scripts (eg. greasemonkey. ) which has a more powerful xmlhttpRequest.
     

Share This Page