** IE5, IE6 and NETSCAPE COMPATIBILITY PROBLEM **

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

    ** IE5, IE6 and NETSCAPE COMPATIBILITY PROBLEM **

    Good morning all from italy,

    i have probably a compatibility problem with a html/javascript page.
    The aim of the code of the file test.htm you find here following (copy the
    3 files in the
    same directory) is to change the content of a layer, created with the
    <div...> tag, with an external text (clicking over an hiperlink) or with the
    result of a <form...> submition. The solution (I haven't been able to find
    anyone else) is to use a hidden <iframe...> as temporary container of the
    text request or the form aswer, and then take its content with javascript
    functions and copy it in the layer. It work, but just with IE 6. I tried
    with IE 5, but it doesn't work. It don't know with Netscape. Somebody know
    where is the problem and if I can do in a different manner? Thank you very
    much,

    Federico.


    ***************
    this is the file test.htm
    *************** **

    <!-- saved from url=(0022)http://internet.e-mail -->
    <%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %>
    <html>
    <head>
    <title>Untitl ed Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaS cript" type="text/JavaScript">
    <!--
    function MM_reloadPage(i nit) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if
    ((appName=="Net scape")&&(parse Int(appVersion) ==4)) {
    document.MM_pgW =innerWidth; document.MM_pgH =innerHeight;
    onresize=MM_rel oadPage; }}
    else if (innerWidth!=do cument.MM_pgW || innerHeight!=do cument.MM_pgH)
    location.reload ();
    }
    MM_reloadPage(t rue);

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document;
    if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
    d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
    x=d.forms[i][n];
    for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
    x=MM_findObj(n, d.layers[i].document);
    if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
    }

    function MM_setTextOfLay er(objName,x,ne wText) { //v4.01
    if ((obj=MM_findOb j(objName))!=nu ll) with (obj)
    if (document.layer s) {document.write (unescape(newTe xt));
    document.close( );}
    else innerHTML = unescape(newTex t);
    }
    function showText(){
    theText = window.textFile .document.body. innerHTML;
    MM_setTextOfLay er('Layer1','', theText)
    }
    //-->
    </script>
    </head>
    <html>

    <body>
    <div id="Layer1" style="position :absolute; left:218px; top:120px;
    width:205px; height:134px; z-index:1"></div>
    <form>
    <iframe id="textFile" name="textFile" style="display: none"
    onLoad="showTex t()"></iframe>
    <input type=button value=Hallo onClick="window .textFile.locat ion =
    'testo.txt'">
    </form>
    <form action="script. php" method="post" target="textFil e"><input
    name="testo" type="text"><in put value="submit html test"
    type="submit"></form>
    <p>&nbsp;</p>
    <p onClick="window .textFile.locat ion = 'testo.txt'"><u ><font
    color="#0000FF" >test</font></u>
    </p>
    </body>
    </html>
    -----------------------------------



    *************** **********
    this is the file script.php
    *************** ************

    <%@LANGUAGE="JA VASCRIPT" CODEPAGE="CP_AC P"%>
    <html>
    <head>
    <title>Untitl ed Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>

    <? echo("this is a test: $testo"); ?>
    </body>
    </html>

    ----------------------------------------



    *************** **
    this is the file testo.txt
    *************** ****

    this is a test file!!!





  • Nobody

    #2
    Re: ** IE5, IE6 and NETSCAPE COMPATIBILITY PROBLEM **


    "Federico Bari" <fede72bari@tis cali.it> wrote in message
    news:bj7ihq$9t1 $2@lacerta.tisc alinet.it...
    | Good morning all from italy,
    |
    | i have probably a compatibility problem with a html/javascript page.
    | The aim of the code of the file test.htm you find here following (copy
    the
    | 3 files in the
    | same directory) is to change the content of a layer, created with the
    | <div...> tag, with an external text (clicking over an hiperlink) or with
    the
    | result of a <form...> submition. The solution (I haven't been able to find
    | anyone else) is to use a hidden <iframe...> as temporary container of the
    | text request or the form aswer, and then take its content with javascript
    | functions and copy it in the layer. It work, but just with IE 6. I tried
    | with IE 5, but it doesn't work. It don't know with Netscape. Somebody know
    | where is the problem and if I can do in a different manner? Thank you very
    | much,

    Will work fine in IE4+ guaranteed. I built a cottage industry out of hidden
    IFrames and updating Div's in such a fashion. It can work with NS6/Mozilla
    and Opera as well, but may require slight variations in your script. I
    don't have the time to wade through all of that. You might post an abridged
    version...

    |
    | Federico.
    |
    |
    | ***************
    | this is the file test.htm
    | *************** **
    |
    | <!-- saved from url=(0022)http://internet.e-mail -->
    | <%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %>
    | <html>
    | <head>
    | <title>Untitl ed Document</title>
    | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    | <script language="JavaS cript" type="text/JavaScript">
    | <!--
    | function MM_reloadPage(i nit) { //reloads the window if Nav4 resized
    | if (init==true) with (navigator) {if
    | ((appName=="Net scape")&&(parse Int(appVersion) ==4)) {
    | document.MM_pgW =innerWidth; document.MM_pgH =innerHeight;
    | onresize=MM_rel oadPage; }}
    | else if (innerWidth!=do cument.MM_pgW || innerHeight!=do cument.MM_pgH)
    | location.reload ();
    | }
    | MM_reloadPage(t rue);
    |
    | function MM_findObj(n, d) { //v4.01
    | var p,i,x; if(!d) d=document;
    | if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
    | d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
    | if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
    | x=d.forms[i][n];
    | for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
    | x=MM_findObj(n, d.layers[i].document);
    | if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
    | }
    |
    | function MM_setTextOfLay er(objName,x,ne wText) { //v4.01
    | if ((obj=MM_findOb j(objName))!=nu ll) with (obj)
    | if (document.layer s) {document.write (unescape(newTe xt));
    | document.close( );}
    | else innerHTML = unescape(newTex t);
    | }
    | function showText(){
    | theText = window.textFile .document.body. innerHTML;
    | MM_setTextOfLay er('Layer1','', theText)
    | }
    | //-->
    | </script>
    | </head>
    | <html>
    |
    | <body>
    | <div id="Layer1" style="position :absolute; left:218px; top:120px;
    | width:205px; height:134px; z-index:1"></div>
    | <form>
    | <iframe id="textFile" name="textFile" style="display: none"
    | onLoad="showTex t()"></iframe>
    | <input type=button value=Hallo onClick="window .textFile.locat ion =
    | 'testo.txt'">
    | </form>
    | <form action="script. php" method="post" target="textFil e"><input
    | name="testo" type="text"><in put value="submit html test"
    | type="submit"></form>
    | <p>&nbsp;</p>
    | <p onClick="window .textFile.locat ion = 'testo.txt'"><u ><font
    | color="#0000FF" >test</font></u>
    | </p>
    | </body>
    | </html>
    | -----------------------------------
    |
    |
    |
    | *************** **********
    | this is the file script.php
    | *************** ************
    |
    | <%@LANGUAGE="JA VASCRIPT" CODEPAGE="CP_AC P"%>
    | <html>
    | <head>
    | <title>Untitl ed Document</title>
    | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    | </head>
    |
    | <body>
    |
    | <? echo("this is a test: $testo"); ?>
    | </body>
    | </html>
    |
    | ----------------------------------------
    |
    |
    |
    | *************** **
    | this is the file testo.txt
    | *************** ****
    |
    | this is a test file!!!
    |
    |
    |
    |
    |


    Comment

    • Federico Bari

      #3
      Re: ** IE5, IE6 and NETSCAPE COMPATIBILITY PROBLEM **

      hank you ... i supposed iframe was supported by IE4+ ... but that html code
      doesn't work with IE5, as i tried in 2 PC just this morning!!! So maybe it
      could be a javascript problem with IE5??


      Comment

      • Nobody

        #4
        Re: ** IE5, IE6 and NETSCAPE COMPATIBILITY PROBLEM **


        "Federico Bari" <fede72bari@tis cali.it> wrote in message
        news:bj7vfn$ip7 $1@lacerta.tisc alinet.it...
        | hank you ... i supposed iframe was supported by IE4+ ... but that html
        code

        our welcome. Yes it is.

        | doesn't work with IE5, as i tried in 2 PC just this morning!!! So maybe it

        Problem with the code!

        | could be a javascript problem with IE5??
        |
        |

        Er. A javascript problem with you script that happens to break IE5. Yes.
        I think you have a handle on it. Lets see what you've got here...

        Good morning all from italy,

        i have probably a compatibility problem with a html/javascript page.
        The aim of the code of the file test.htm you find here following (copy the
        3 files in the
        same directory) is to change the content of a layer, created with the
        <div...> tag, with an external text (clicking over an hiperlink) or with the
        result of a <form...> submition. The solution (I haven't been able to find
        anyone else) is to use a hidden <iframe...> as temporary container of the
        text request or the form aswer, and then take its content with javascript
        functions and copy it in the layer. It work, but just with IE 6. I tried
        with IE 5, but it doesn't work. It don't know with Netscape. Somebody know
        where is the problem and if I can do in a different manner? Thank you very
        much,

        Federico.


        ***************
        this is the file test.htm
        *************** **

        <!-- saved from url=(0022)http://internet.e-mail -->
        <%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %>
        <html>
        <head>
        <title>Untitl ed Document</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <script language="JavaS cript" type="text/JavaScript">
        <!--
        function MM_reloadPage(i nit) { //reloads the window if Nav4 resized
        if (init==true) with (navigator) {if
        ((appName=="Net scape")&&(parse Int(appVersion) ==4)) {
        document.MM_pgW =innerWidth; document.MM_pgH =innerHeight;
        onresize=MM_rel oadPage; }}
        else if (innerWidth!=do cument.MM_pgW || innerHeight!=do cument.MM_pgH)
        location.reload ();
        }
        MM_reloadPage(t rue);

        function MM_findObj(n, d) { //v4.01
        var p,i,x; if(!d) d=document;
        if((p=n.indexOf ("?"))>0&&paren t.frames.length ) {
        d=parent.frames[n.substring(p+1 )].document; n=n.substring(0 ,p);}
        if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.fo rms.length;i++)
        x=d.forms[i][n];
        for(i=0;!x&&d.l ayers&&i<d.laye rs.length;i++)
        x=MM_findObj(n, d.layers[i].document);
        if(!x && d.getElementByI d) x=d.getElementB yId(n); return x;
        }

        function MM_setTextOfLay er(objName,x,ne wText) { //v4.01
        if ((obj=MM_findOb j(objName))!=nu ll) with (obj)
        if (document.layer s) {document.write (unescape(newTe xt));
        document.close( );}
        else innerHTML = unescape(newTex t);
        }
        function showText(){
        theText = window.textFile .document.body. innerHTML;
        MM_setTextOfLay er('Layer1','', theText)
        }
        //-->
        </script>


        Note 1. MM spells MacroMedia (and big trouble)

        Lord this stuff is from Adobe GoLive! (or similar ilk) I would scrap all of
        this code to start with...

        </head>
        <html>

        <body>
        <div id="Layer1" style="position :absolute; left:218px; top:120px;
        width:205px; height:134px; z-index:1"></div>

        Note 2. z-index? Needed?

        Why the z-index spec. on the first element on the page?

        <form>
        <iframe id="textFile" name="textFile" style="display: none"
        onLoad="showTex t()"></iframe>
        <input type=button value=Hallo onClick="window .textFile.locat ion
        ='testo.txt'">

        Note 3. This could be the problem!

        window.textFile ? That's not right. You want to use location.replac e
        anyway.

        if (document.getEl ementById)
        getElement = new Function("id", "return document.getEle mentById(id)")
        else if (document.all)
        getElement = new Function("id", "return document.all[id]")

        var e = getElement("tex tFile")

        if (e.location.rep lace)
        e.location.repl ace("testo.txt" );
        else
        e.location.href = "testo.txt"

        </form>
        <form action="script. php" method="post" target="textFil e"><input
        name="testo" type="text"><in put value="submit html test"
        type="submit"></form>

        Note 4. Mozilla, Netscape, Opera and others will open new windows when this
        form is posted. Assign the target programmaticall y only after determining
        that it is IE4+, You could use the IE conditional comments to handle IE5+
        with a default of checking for (document.all && !document.getEl ementById)
        to handle IE4.

        <p>&nbsp;</p>

        Note 5. I really hate to see stuff like this.

        <p onClick="window .textFile.locat ion = 'testo.txt'"><u ><font
        color="#0000FF" >test</font></u></p>


        Note 6. WTF!

        No no no no no no no no. What's all this then? Where to start? How about:

        <p><script type="text/javascript">doc ument.write("<a onclick='change The
        Location()'>tes t<\/a>")</script></p>

        where changeTheLocati on is a function that executes the previous example
        code about changing the Iframe location.

        </body>
        </html>
        ^^^
        This is okay.

        *************** **********


        *************** **********
        this is the file script.php
        *************** ************
        Which seems to do nothing. Doesn't matter at this point though.

        <%@LANGUAGE="JA VASCRIPT" CODEPAGE="CP_AC P"%>
        <html>
        <head>
        <title>Untitl ed Document</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        </head>

        <body>

        <? echo("this is a test: $testo"); ?>
        </body>
        </html>

        ----------------------------------------



        *************** **
        this is the file testo.txt
        *************** ****

        this is a test file!!!


        What is this one for? Your php script should output javascript that updates
        elements on its parent page.





        Comment

        • Federico Bari

          #5
          Re: ** IE5, IE6 and NETSCAPE COMPATIBILITY PROBLEM **

          thank you all! Will try your suggestions! ^_^

          Federico.


          Comment

          Working...