Results 1 to 6 of 6

Thread: IE7 Error Message Access denied

  1. #1
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IE7 Error Message Access denied

    Good day-

    I have an ajax function that allows me to load pages into a specified div

    link here for the script http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    this may be due to rendering locally, but it works fine in Fire Fox, however in IE7 the error message appears

    any thoughts?

  2. #2
    Join Date
    Feb 2007
    Posts
    293
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Check your security settings. In IE7, the default settings for cross-domain data access were set to "deny" for all security zones. (Tools -> Internet Options -> Security -> Custom Level -> “Access data sources across domains” checked or not) It may also be set to not allow active-x controls or plug-ins to run.
    If it's a problem with security settings, you can fix it on your computer, but it won't work on other computers that haven't done so.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That script doesn't work locally in IE 7. If it works in FF once the page is live, it should work in IE 7 once the page is live. If you need to use the script primarily locally, it can be modified to also work locally in IE 7, but if the primary use will be live, it is best not to alter the code.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks, i will try it live on the server and see if it works...

    ill let you know

    thanks again

  5. #5
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default modify code

    How could I modify this code work on the local drive?

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Reverse the order and the sense of the opening tests (changes red):

    Code:
    function ajaxpage(url, containerid){
    var page_request = false
    if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    if (bustcachevar) //if bust caching of external page
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    page_request.open('GET'
    But, as the XMLHttpRequest is more efficient and can be used live by IE 7, this shouldn't be used with a live implementation. It will allow for local testing in IE 7, and, if your primary usage will be local, is perfectly fine.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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