XMLHttpRequest

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gianluca

    XMLHttpRequest

    Hi all,

    I developed a portal using Joomla 1.0.13 and Joomlajax (a plugin to
    implement Ajax in Joomla, based on Scriptaculous and Prototype) as
    core.
    I added some javascript code on index.php to use the XMLHttpRequest
    object and all work fine on IE 6, FF, Opera, and Safari but I've a lot
    of trouble with IE 7 on XP and Vista: "Access Denied" when I click on
    some link.

    The problem isn't systematic: sometime I can resolve with a refresh of
    the page, sometime it seem impossible to view the page.
    On my system (Windows XP + IE 7) I NEVER seen the problem.
    I checked for a possibile "cross-domain", but all script that I call
    are in the same domain.
    This is the implementation for the XMLHttpRequest object:

    function createQCObject( ) {

    var xmlhttp=false;

    /* running locally on IE5.5, IE6, IE7 */
    if(location.pro tocol=="file:") {
    if(!xmlhttp)
    try{
    xmlhttp=new ActiveXObject(" MSXML2.XMLHTTP" );
    }
    catch(e){
    xmlhttp=false;
    }
    if(!xmlhttp)
    try{
    xmlhttp=new ActiveXObject(" Microsoft.XMLHT TP");
    }
    catch(e){
    xmlhttp=false;
    }
    }

    /* IE7, Firefox, Safari, Opera... */
    if(!xmlhttp)
    try{
    xmlhttp=new XMLHttpRequest( );
    }
    catch(e){
    xmlhttp=false;
    }

    /* IE6 */
    if(typeof ActiveXObject != "undefined" ){
    if(!xmlhttp)
    try{
    xmlhttp=new ActiveXObject(" MSXML2.XMLHTTP" );
    }
    catch(e){
    xmlhttp=false;
    }
    if(!xmlhttp)
    try{
    xmlhttp=new ActiveXObject(" Microsoft.XMLHT TP");
    }
    catch(e){
    xmlhttp=false;
    }
    }

    /* IceBrowser */
    if(!xmlhttp)
    try{
    xmlhttp=createR equest();
    }
    catch(e){
    xmlhttp=false;
    }

    return xmlhttp;
    }

    Any ideas/suggestions?

    Thanks in advance.

    Gianluca
  • Richard Cornford

    #2
    Re: XMLHttpRequest

    Gianluca wrote:
    I developed a portal using Joomla 1.0.13 and Joomlajax (a
    plugin to implement Ajax in Joomla, based on Scriptaculous
    and Prototype) as core.
    I added some javascript code on index.php to use the
    XMLHttpRequest object and all work fine on IE 6, FF, Opera,
    and Safari but I've a lot of trouble with IE 7 on XP and
    Vista: "Access Denied" when I click on some link.
    >
    The problem isn't systematic: sometime I can resolve with
    a refresh of the page, sometime it seem impossible to view
    the page. On my system (Windows XP + IE 7) I NEVER seen the
    problem. I checked for a possibile "cross-domain", but all
    script that I call are in the same domain.
    This is the implementation for the XMLHttpRequest object:
    <snip>
    Any ideas/suggestions?
    From Windows XP on Microsoft radically improved the integrity of memory
    access (presumably a security measure). One of the impacts of this on
    browser scripting is that if you, for example, store a reference to a
    DOM node from a document in a FRAME or IFRAME in javascript in the
    containing frame any attempts to access that object through the stored
    reference after the contained FRAME/IFRAME's document had been unloaded
    will produce a "Access denied" error. This was not the case with Windows
    2000 and all predating Windows versions.

    Of course that is just one specific example, but the code you posted is
    insufficient for any assessment of whether this is even a relevant
    consideration. Though this possibility can be ruled out if you can
    demonstrate that IE 6 on windows XP is fine, as then it cannot be an OS
    issue.

    Richard.

    Comment

    • Gianluca

      #3
      Re: XMLHttpRequest

      From Windows XP on Microsoft radically improved the integrity of memory
      access (presumably a security measure). One of the impacts of this on
      browser scripting is that if you, for example, store a reference to a
      DOM node from a document in a FRAME or IFRAME in javascript in the
      containing frame any attempts to access that object through the stored
      reference after the contained FRAME/IFRAME's document had been unloaded
      will produce a "Access denied" error. This was not the case with Windows
      2000 and all predating Windows versions.
      >
      Of course that is just one specific example, but the code you posted is
      insufficient for any assessment of whether this is even a relevant
      consideration. Though this possibility can be ruled out if you can
      demonstrate that IE 6 on windows XP is fine, as then it cannot be an OS
      issue.
      >
      Richard.
      The "system" work fine on IE 6 on my pc, but on my pc IE 7 works too;
      it could be negligible.
      Do you have any idea to bypass the problem? You say that the code is
      insufficient: do you have some
      improvement to suggest?
      References on the web are good.

      Thanks for your answer.

      Gianluca

      Comment

      Working...