...

View Full Version : ie incompatibility



eydg
11-21-2012, 01:34 AM
Could you please identify, why this piece doesn't work with internet explorer6
while it works in chrome, firefox and opera?
ey


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


<body onLoad="ST()" >
<center>
<table border="0">
<tbody>
<tr>
<td><form name="item">
<pre>&nbsp;</pre>
<table border="0" cellspacing="0" cellpadding="0"
width=1000px>
<tr>
<td height="89">&nbsp;</td>
</tr>
<tr>
<td height="82"><p>toy
<input type="TEXT" name="a" size="20" value=""
id="okno">
</p>
<p>
<input type="button" value=" UP "

onClick="dawaj()">
<input type="button" value=" DOWN "

onClick="dawaj2()">
</p></td>
</tr>
<tr>
<td height="78">&nbsp;</td>
</tr>
</table>
<center>
</center>
</form>

</tbody>
</table>
</center>
<script>
n=1;

function
SH(v){zz=v.length;for(i=1;i<(zz);i++){y=r(zz);x=r(zz);z=v[y];v[y]=v[x];v[x
]=z}}
function ST(){SH(item);b=item.length;}

function dawaj(){
n=n+1; if (n>b-1){n=1}
if(item[n]==null){n=0};x=item[n];v=new
Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l
;i++;x=x.substring(x.ind
exOf("|")+1)};

document.item.a.value=v[0];
}

function dawaj2(){
//
n=n-1;if (n<1){n=b-1}
if(item[n]==null){n=0};x=item[n];v=new
Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l
;i++;x=x.substring(x.ind
exOf("|")+1)};

document.item.a.value=v[0];
}


function r(){}


item=new Array("",
"boy|strong|brave",
"girl|pretty|smart",
"dog|furry|friendly"
);

</script>
</body>
</html>

Old Pedant
11-21-2012, 01:53 AM
You really CARE about IE6???

Most of us have about given up on even IE7, since it is so old. IE6 is really getting ancient.

However...

It just MIGHT help if you told us WHAT doesn't work.

As it is, we have no way of knowing, since most of us no longer have IE6 to test it with.

Logic Ali
11-21-2012, 02:34 AM
The code as posted is full of illegal line breaks, and so won't run anywhere.
Once formatted you'll see that the IE error console indicates 'object doesn't support this action'.
It soon becomes clear that it doesn't like the reference to item, which in I.E. is a global object. Call it something else.

eydg
11-21-2012, 03:18 AM
Yes, these sure are valid points. It appears my ie is 7 (so also dated) but the point is that I am facing problems with making an app names siteinfile transform my page into an exe. I instantly connected it with the errors in ie, which do not manifest themselves in chrome, firefox adn opera, admittedly, newer.

Here's the code without the line breaks, and "item" changed to "Sache".


I may gave undertaken a wrong approach in assuming that seasoned js coders would catch any flaws in the code like this, and this is what my question is about: is the JS piece of code written properly?

While in chrome the buttons switch between three kinds of toys, in ie7 they take no effect - nothing shows up.



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


<body onLoad="ST()" >
<center>
<table border="0">
<tbody>
<tr>
<td><form name="sache">
<pre>&nbsp;</pre>
<table border="0" cellspacing="0" cellpadding="0"
width=1000px>
<tr>
<td height="89">&nbsp;</td>
</tr>
<tr>
<td height="82"><p>toy
<input type="TEXT" name="a" size="20" value=""
id="okno">
</p>
<p>
<input type="button" value=" UP "

onClick="dawaj()">
<input type="button" value=" DOWN "

onClick="dawaj2()">
</p></td>
</tr>
<tr>
<td height="78">&nbsp;</td>
</tr>
</table>
<center>
</center>
</form>

</tbody>
</table>
</center>
<script>
n=1;

function
SH(v){zz=v.length;for(i=1;i<(zz);i++){y=r(zz);x=r(zz);z=v[y];v[y]=v[x];v[x
]=z}}
function ST(){SH(sache);b=sache.length;}

function dawaj(){
n=n+1; if (n>b-1){n=1}
if(sache[n]==null){n=0};x=sache[n];v=new Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l
;i++;x=x.substring(x.indexOf("|")+1)};

document.sache.a.value=v[0];
}

function dawaj2(){
//
n=n-1;if (n<1){n=b-1}
if(sache[n]==null){n=0};x=sache[n];v=new
Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l
;i++;x=x.substring(x.indexOf("|")+1)};

document.sache.a.value=v[0];
}


function r(){}


sache=new Array("","boy|strong|brave","girl|pretty|smart","dog|furry|friendly");

</script>
</body>
</html>

Logic Ali
11-21-2012, 04:34 AM
Still you ignore the error console. Rename the form element (and the references to it) to something different to any global variable.

Proof:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


<body onLoad="ST()" >
<center>
<table border="0">
<tbody>
<tr>
<td><form name="xsache">
<pre>&nbsp;</pre>
<table border="0" cellspacing="0" cellpadding="0"
width=1000px>
<tr>
<td height="89">&nbsp;</td>
</tr>
<tr>
<td height="82"><p>toy
<input type="TEXT" name="a" size="20" value=""
id="okno">
</p>
<p>
<input type="button" value=" UP "

onClick="dawaj()">
<input type="button" value=" DOWN "

onClick="dawaj2()">
</p></td>
</tr>
<tr>
<td height="78">&nbsp;</td>
</tr>
</table>
<center>
</center>
</form>

</tbody>
</table>
</center>
<script>
n=1;

function
SH(v){zz=v.length;for(i=1;i<(zz);i++){y=r(zz);x=r(zz);z=v[y];v[y]=v[x];v[x
]=z}}
function ST(){SH(sache);b=sache.length;}

function dawaj(){
n=n+1; if (n>b-1){n=1}
if(sache[n]==null){n=0};x=sache[n];v=new Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l
;i++;x=x.substring(x.indexOf("|")+1)};

document.xsache.a.value=v[0];
}

function dawaj2(){
//
n=n-1;if (n<1){n=b-1}
if(sache[n]==null){n=0};x=sache[n];v=new
Array;x=x+"|";i=0;while(x.length>1){l=x.substring(0,x.indexOf("|"));v[i]=l
;i++;x=x.substring(x.indexOf("|")+1)};

document.xsache.a.value=v[0];
}


function r(){}


sache=new Array("","boy|strong|brave","girl|pretty|smart","dog|furry|friendly");

</script>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum