Results 1 to 3 of 3

Thread: Ajax Include on IE7 offline

  1. #1
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax Include on IE7 offline

    1) Script Title: Ajax Includes script- © Dynamic Drive DHTML code library

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...axincludes.htm


    My Test Site
    http://martee.net/TestTabInclude/testInclude.html or
    http://martee.net/TestTabInclude/testIncludeExt.html

    Files
    - testInclude.html
    - testIncludeExt.html (uses external js file)
    - ./js/testInclude.js

    3) Describe problem: NOTE - This is probably the wrong forum to be asking this at, but here goes.

    The Script works Wonderful on-line.

    The Script works Wonderful off-line locally UNTIL I got this new machine, it has Vista and IE7. Actually further testing has shown it is not Vista but IE7. FF, etc all work good on XP and Vista.

    What happens and this does appear to be a security issue, is that it first questions the Active Content, but after acknowledging that and telling it to go forth and do good, it then comes up with 'Access is Denied'.

    Like I said, it runs great online, but testing locally it doesnt, anyone got a suggestion or idea or direction I can go in.

    Thanks in advance

  2. #2
    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

    This is an odd situation. It is due to the fact that these scripts were coded for IE 6, or before IE 7, or thinking primarily about the differences between IE 6 and other browsers.

    You see, IE 7 can do Ajax the same way that other browsers do, but won't do it locally. The script could be rewritten to make IE 7 take the IE 6 path when the page is local, but it isn't really worth it. Test in FF locally, IE 7 online.

    You can do something like:

    Code:
    function ajaxinclude(url) {
    var page_request = false
    if (window.XMLHttpRequest&&(!window.ActiveXObject||/http/.test(url))) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    } . . .
    To force IE 7 into using the Active X approach locally, but this runs the risk of sometimes also making it do so live, and the window.XMLHttpRequest approach is considered more efficient, and can be run live on IE 7 browsers allowing javascript but not Active X, so is certainly more likely to work. Adding these extra conditions could possibly cause problems for other browsers as well. You could do this locally to test the layout of your script's output in IE 7 though, but use the script without this modification when uploading it to the server.
    - John
    ________________________

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

  3. #3
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank You...

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
  •