AJAX call program from another server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • syok90
    New Member
    • Dec 2007
    • 1

    AJAX call program from another server

    i'm doing a lot of AJAX PROGRAM in my website
    1. madads.myadswor ld.com
    2. eshop.myadsworl d.com
    3. syokchat.myadsw orld.com

    i just want to ask:
    can i call my php program from another server.normal way getjumrek.php program is in same server. Can i write var gettxt = http://192.168.1.40/getjumrek.php (this case current server is 192.168.1.41 but there is also getjumrek.php in 192.168.1.40)

    example

    [CODE=javascript]var gettxt = "getjumrek.php" ;
    var httpReceive5Txt = getHTTPObject() ;
    function receivetxt() {
    //alert('aa');
    if (httpReceiveTxt .readyState == 4 || httpReceiveTxt. readyState == 0) {
    httpReceiveTxt. open("GET",GetT xt + '?lastkey=' + lastkey, true);
    httpReceiveTxt. onreadystatecha nge = handlehHttpRece iveTxt;
    httpReceiveTxt. send(null);
    }
    }



    //deals with the servers' reply to requesting new content
    function handlehHttpRece iveTxt() {
    }

    getHTTPObject() {}[/CODE]
    Last edited by gits; Dec 1 '07, 11:00 AM. Reason: added code tags
  • phvfl
    Recognized Expert New Member
    • Aug 2007
    • 173

    #2
    Standard AJAX calls can not be cross domain, so you can only call to the same server.

    Comment

    Working...