Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post

    Ajax has no access

    I'm using an HTA file with an iframe inside so I can use ASP code, I have the below JavaScript:

    PHP Code:
    function xmlhttp() {
        if (
    window.XMLHttpRequest) {
            
    xmlhttp=new XMLHttpRequest();
        }
        else {
            
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        return 
    xmlhttp;
    }
    function 
    load_dialog(dig) {
        var 
    http xmlhttp();
        
    http.onreadystatechange = function () {
            if (
    http.readyState == && http.status == 200) {
                
    document.getElementById("dialog").innerHTML http.responseText;
            }
        }
        
    http.open("GET""forms/login.asp"true);
        
    http.send();

    This message is being displayed when I execute the function:


    WHat do I need to change to give the application access to the file?

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    I don't see the message?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post
    The picture, dialog titles "Script error" with error message "Access denied"

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    My network must be blocking it.. I don't see it. Sorry.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #5
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    an hta file? are you serving this file on a web server or accessing the file locally? could be running into same domain issues.

  • Users who have thanked DanInMa for this post:

    martynball (05-11-2013)

  • #6
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post
    It is all located in C:\inetpub\wwwroot\foldername

  • #7
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    But is your browser going to "http://localhost", or "file:///C:\inetpub\wwwroot\foldername"?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • Users who have thanked WolfShade for this post:

    martynball (05-11-2013)

  • #8
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    the scond wolfshade

  • #9
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    That might be why. Try using http://localhost/path/to/whatever. If you need to use a different port, don't forget the :portnumber after localhost. See if that makes a difference.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • Users who have thanked WolfShade for this post:

    martynball (05-11-2013)

  • #10
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,297
    Thanks
    10
    Thanked 584 Times in 565 Posts
    you need to point to asp files using localhost or 127.0.0.1, reading them as a file just spits out the code, it doesn't execute it.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • Users who have thanked rnd me for this post:

    martynball (05-11-2013)

  • #11
    Regular Coder
    Join Date
    Nov 2007
    Posts
    680
    Thanks
    319
    Thanked 1 Time in 1 Post
    Quote Originally Posted by rnd me View Post
    you need to point to asp files using localhost or 127.0.0.1, reading them as a file just spits out the code, it doesn't execute it.
    Yes thanks, that works.

  • #12
    New Coder
    Join Date
    May 2013
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you looked into access-control-allow-origin: * in your headers?


  •  

    Posting Permissions

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