trying to call a remote javascript file that gets info from php

Discussion in 'Programming' started by darkmessiah, Nov 30, 2007.

  1. #1
    Here's the deal, I am getting access denied froma script that I know should work, from what I understand.

    I am calling .js file from one domain, which in the the script does a call to a php file on the same domain, yet I am still getting access denied.

    example
    
    <script type="text/javascript">
    //some variables to set
    </script>
    <script type="text/javascript" src="http://www.site.com/folder/script.js">
    </script>
    
    Code (markup):
    Now, withing the .js file I am calling a php from the same domain and folder, yet it's acting like I just called the php file from a different domain.

    Here's snippet from the .js URL is the url to the php file. I only do this because the php file is getting info from a completely different domain.
    
    var request = "http://www.site.com/folder/file.php";
    try {
    request = new XMLHttpRequest();
    
    } catch (e) { request = new ActiveXObject("Msxml2.XMLHTTP"); }
    
    
    request.open("GET",URL,false);
    request.send();
    
    document.write(request.responseText); 
    
    Code (markup):
    I need to be able to let others call this script.
     
    darkmessiah, Nov 30, 2007 IP
  2. darkmessiah

    darkmessiah Peon

    Messages:
    500
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    got it all working, no idea what was going on, but in the end I've got to work out some iframe issues in wordpress.
     
    darkmessiah, Nov 30, 2007 IP