Jump to content

ajax site wont work in ie 6... need help


alapimba

Recommended Posts

Hello

I designed a site for a friend, the site is working perfectly on ie7, but on ie6 it's not working as it should. the site basicly is an acordeon with areas loaded using ajax.

 

Anyone can help me finding whats wrong here?

the site is www.nunonunes-ferreira.com

 

Thanks

Link to comment
Share on other sites

how are you creating your XMLHttpRequest object?

 

Notice the three different ways of creating the object, 2 of which are for IE

 

I use:

 

//create the Ajax request object - test for browser support

var ajax = false;

if(window.XMLHttpRequest) {
   ajax = new XMLHttpRequest();
} else if(window.ActiveXObject) {
   try {
      ajax = new ActiveXObject("Msxml2.XMLHTTP");
   } catch(e1) {
      try{
         ajax = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(e2) {}
   }
}

if(!ajax) {
   alert("Some page functionality is unavailable");
}

 

More info here:

http://getfido.net/forum/viewtopic.php?f=3&t=4

Link to comment
Share on other sites

here is my source code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Nuno Nunes-Ferreira</title>

<!-- Meta Tags -->
<meta name="robots" content="index, follow" />
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="javascript/pngfix.js"></script>
<![endif]-->

<!-- JavaScript -->
  <!-- <script type="text/javascript" src="combine.php?type=javascript&files=prototype.js,effects.js,accordion.js,code_highlighter.js,javascript.js,html.js"></script> -->


<script type="text/javascript" src="javascript/prototype.js"></script>
<script type="text/javascript" src="javascript/effects.js"></script>
<script type="text/javascript" src="javascript/accordion.js"></script>
<script type="text/javascript" src="javascript/lightbox.js"></script>

<!-- CSS -->
  <link rel="stylesheet" type="text/css" href="css/default.css" />
    
<script type="text/javascript">

	//
	//  In my case I want to load them onload, this is how you do it!
	// 
	Event.observe(window, 'load', loadAccordions, false);

	//
	//	Set up all accordions
	//
	function loadAccordions() {

		var bottomAccordion = new accordion('vertical_container');

		var nestedVerticalAccordion = new accordion('vertical_nested_container', {
		  classNames : {
				toggle : 'vertical_accordion_toggle',
				toggleActive : 'vertical_accordion_toggle_active',
				content : 'vertical_accordion_content'
			}
		});

		// Open first one
		//bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);

		// Open second one
		//topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]);
	}

</script>
<script type="text/javascript">
<!--
var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

function solo(numero3) {
  http.open("GET", "solo.php?ano=" + numero3, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('solo').innerHTML = http.responseText;
  group(numero3);
    }
  }
  http.send(null);
}
function group(numero4) {
  http.open("GET", "group.php?ano=" + numero4, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('group').innerHTML = http.responseText;
  other(numero4);
    }
  }
  http.send(null);
}
function other(numero5) {
  http.open("GET", "other.php?ano=" + numero5, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('other').innerHTML = http.responseText;
  titulo(numero5); 
    }
  }
  http.send(null);
}
function titulo(numero) {
http.open("GET", "titulo1.php?id_ano=" + numero , true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('titulo').innerHTML = http.responseText;
  replace(numero);
    }
  }
  http.send(null);
}  
function replace(numero2) {
  http.open("GET", "imgs.php?id_ano=" + numero2 , true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('imgs').innerHTML = http.responseText;
   initLightbox();
    }
  }
  http.send(null);
}
function titulo2(numero) {
http.open("GET", "titulo3.php?id=" + numero , true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('titulo').innerHTML = http.responseText;
  replace2(numero);
    }
  }
  http.send(null);
}  
function replace2(numero2) {
  http.open("GET", "imgs3.php?id=" + numero2, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('imgs').innerHTML = http.responseText;
   initLightbox();
    }
  }
  http.send(null);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script> 

<!-- CSS -->
<style type="text/css" >

	/*
		Vertical Accordions
	*/

	.accordion_toggle {
		display: block;
		height: 30px;
		width: 100%;
		background: #ffffff;
		padding: 0 10px 0 40px;
		line-height: 30px;
		color: #000000;
		font-weight: normal;
		text-decoration: none;
		outline: none;
		font-size: 12px;
		color: #000000;
		border-bottom: 1px solid #F0EBE9;
		cursor: pointer;
		margin: 0 0 0 0;
	}

	.accordion_toggle_active {
	/*cor do topo do menu*/
		background: url(images/accordion_toggle_active.jpg) no-repeat top right #DFDFDF; 
		/*cor da letra*/
		color: #ffffff;
		/*cor da linha por baixo*/
		border-bottom: 1px solid #F0EBE9;
	}

	.accordion_content {
background-color: #E9E9E9;
color: #A6A6A6;
overflow: hidden;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
padding-left: 40px;
	}

		.accordion_content h2 {
			margin: 15px 0 5px 10px;
			color: #0099FF;
		}

		.accordion_content a {
color: #666666;
		}

		.accordion_content p {
			line-height: 150%;
		}

	.vertical_accordion_toggle {
		display: block;
		height: 30px;
		width: 300px;
		background: url(images/accordion_toggle.jpg) no-repeat top right #FFFFFF;
		padding: 0 10px 0 10px;
		line-height: 30px;
		color: #A6A6A6;
		font-weight: normal;
		text-decoration: none;
		outline: none;
		font-size: 12px;
		color: #000000;
		border-bottom: 1px solid #f0ebe9;
		cursor: pointer;
		margin: 0 0 0 0;
	}

	.vertical_accordion_toggle_active {
		background: url(images/accordion_toggle_active.jpg) no-repeat top right #DFDFDF;
		color: #000000;
		border-bottom: 1px solid #f0ebe9;
	}

	.vertical_accordion_content {
color: #A6A6A6;
overflow: hidden;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
	}

		.vertical_accordion_content h2 {
			margin: 15px 0 5px 10px;
			color: #0099FF;
		}

		.vertical_accordion_content p {
			line-height: 150%;
			padding: 5px 10px 15px 10px;
		}
  			
	/*				
    /* Container styling*/
   
    
    #vertical_nested_container {
margin: 20px 20px 20px 0px;
width: 100%;
    }
.rights {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style: normal;
margin-bottom: 0px;
vertical-align: bottom;
text-align: left;
padding-right: 20px;
padding-bottom: 20px;
padding-top: 10px;
color: #999999;
padding-left: 40px;
	}
	.foo2 {
line-height: 150%;
padding: 5px 10px 15px 10px;
	}.titulo {
height: 30px;
	}.imgs {
height: 30px;
	}

body {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0px;
background-image: url();
background-color: #E9E9E9;
}
.style2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #999999;
}
    </style>

<link href="javascript/lightbox.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style3 {
font-size: 10px;
color: #666666;
}
a:active.ano {
background-color: #ffffff;
}
a:link.ano {

}
a:hover.ano {
background-color: #ffffff;
}
a:visited.ano {

}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>


</head>

<body>

<div id="container"><br />
    <div id="vertical_container" >
<h1 class="accordion_toggle"><img src="img/nunonunes.png" alt="" width="144" height="30" /></h1>
    <div class="accordion_content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><span class="style2"><br>
        <?php echo $row_rs_topo['texto']; ?>
        
        </span></td>
      </tr>
    </table>
    </div><br />

    

   	<h1 class="accordion_toggle"><img src="img/past.png" alt="" width="41" height="30" /></h1>
	<div class="accordion_content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30"><?php do { ?>
                <a href="#" class="ano" onclick="javascript:solo(<?php echo $row_rs_anos2['id']; ?>); return false"><?php echo $row_rs_anos2['ano'];  ?></a> | 
			<?php } while ($row_rs_anos2 = mysql_fetch_assoc($rs_anos2)); ?></td>
  </tr>
</table>

	  <div id="vertical_nested_container" >
	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="498" valign="top"><div id="imgs"><table border="0" cellpadding="0" cellspacing="1">
      <tr>
        <?php
$rs_imagens_endRow = 0;
$rs_imagens_columns = 4; // number of columns
$rs_imagens_hloopRow1 = 0; // first row flag
do {
    if($rs_imagens_endRow == 0  && $rs_imagens_hloopRow1++ != 0) echo "<tr>";
   ?>
        <td><table width="130" height="130" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="130" height="130" align="center" valign="middle" bgcolor="#FFFFFF">
              <a href="<?php echo $row_rs_imagens['big']; ?>" rel="lightbox" title="<?php echo $row_rs_imagens['descriccao']; ?>"><img src="<?php echo $row_rs_imagens['thumb']; ?>" alt="" border="0" /></a></td>
              </tr>
          
        </table></td>
        <?php  $rs_imagens_endRow++;
if($rs_imagens_endRow >= $rs_imagens_columns) {
  ?>
      </tr>
      <?php
$rs_imagens_endRow = 0;
  }
} while ($row_rs_imagens = mysql_fetch_assoc($rs_imagens));
if($rs_imagens_endRow != 0) {
while ($rs_imagens_endRow < $rs_imagens_columns) {
    echo("<td> </td>");
    $rs_imagens_endRow++;
}
echo("</tr>");
}?>
</table></div>
      <br /><br />
      <div id="titulo"><span class="style3"><?php echo $row_rs_titulo['titulo']; ?></span></div></td>
    <td width="20" valign="top"> </td>
    <td align="left" valign="top">
<h3 class="vertical_accordion_toggle"><img src="img/solo.png" alt="" width="102" height="30" /></h3>
                <div class="vertical_accordion_content">
		<div id="solo">
		  <div class="foo2">
                <?php do { ?>
                  / <a href="#" onclick="titulo2(<?php echo $row_rs_solo['id']; ?>)"><?php echo $row_rs_solo['titulo']; ?></a><br />

  <?php } while ($row_rs_solo = mysql_fetch_assoc($rs_solo)); ?></div>
		</div>
              </div>
                <h3 class="vertical_accordion_toggle"><img src="img/group.png" alt="" width="111" height="30" /></h3>
                <div class="vertical_accordion_content">
                   <div id="group">
                     <div class="foo2">
                       <?php do { ?>
                       / <a href="#" onclick="titulo2(<?php echo $row_rs_group['id']; ?>)"><?php echo $row_rs_group['titulo']; ?></a><br />
                       <?php } while ($row_rs_group = mysql_fetch_assoc($rs_group)); ?><br />  	
              </div>
        </div>
              </div>
                <h3 class="vertical_accordion_toggle"><img src="img/other.png" alt="" width="81" height="30" /></h3>
                <div class="vertical_accordion_content">
                   <div id="other"><div class="foo2">
                     <?php do { ?>
                       / <a href="#" onclick="titulo2(<?php echo $row_rs_others['id']; ?>)"><?php echo $row_rs_others['titulo']; ?></a><br />

                       <?php } while ($row_rs_others = mysql_fetch_assoc($rs_others)); ?></div>
		</div>
              </div></td>
  </tr>
</table>

              
          </div>
          </ul>
	  </p>
  </div><h1 class="accordion_toggle"><img src="img/present.png" alt="" width="55" height="30" /></h1>
	<div class="accordion_content">
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><?php do { ?><br />
              <?php echo $row_rs_present['descricao']; ?><br />
              <?php } while ($row_rs_present = mysql_fetch_assoc($rs_present)); ?><br />
</td>
      </tr>
    </table>
	  </td>
  </tr>
</table>

      </div>


	<h1 class="accordion_toggle"><img src="img/future.png" alt="" width="47" height="30" /></h1>
	<div class="accordion_content">
        	<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><?php do { ?>
          <?php echo $row_rs_future['descricao']; ?><br />
          <?php } while ($row_rs_future = mysql_fetch_assoc($rs_future)); ?></td>
  </tr>
</table>

	</div><br />
	<h1 class="accordion_toggle"><img src="img/contact.png" alt="" width="55" height="30" /></h1>
	<div class="accordion_content">
	  <form id="form1" method="post" action="email.php">
	    <table width="400" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>Phone: </td>
                <td height="30">00 351 919 190 666 </td>
              </tr>
              <tr>
                <td>E-mail:</td>
                <td height="30"><a href="mailto:mail@nunonunes-ferreira.com">mail@nunonunes-ferreira.com</a></td>
              </tr>
              <tr>
                <td>Name</td>
                <td height="30"><label>
                  <input name="nome" type="text" id="nome" size="50" />
                </label></td>
              </tr>
              <tr>
                <td>E-mail</td>
                <td height="30"><label>
                  <input name="mail" type="text" id="mail" size="50" />
                </label></td>
              </tr>
              <tr>
                <td>Text</td>
                <td><label>
                  <textarea name="frase" cols="38" id="frase"></textarea>
                </label></td>
              </tr>
              <tr>
                <td> </td>
                <td height="30"><label>
                  <input name="Submit" type="submit" class="style2" value="Submit" />
                </label></td>
              </tr>
            </table>
          </form>
	  <hr align="left" width="370" size="1" noshade="noshade" />
  </div>
  </div>
</div>
<div class="rights">
All rights reserved nunonunes-ferreira ©</div>
<script type="text/javascript" >
  
//
// You can hide the accordions on page load like this, it maintains accessibility
//
// Special thanks go out to Will Shaver @ http://primedigit.com/
//
var verticalAccordions = $$('.accordion_toggle');
verticalAccordions.each(function(accordion) {
	$(accordion.next(0)).setStyle({
	  height: '0px'
	});
});


</script>


</body>
</html>
<?php
mysql_free_result($rs_anos2);

mysql_free_result($rs_max_ano);

mysql_free_result($rs_solo);

mysql_free_result($rs_group);

mysql_free_result($rs_others);

mysql_free_result($rs_imagens);

mysql_free_result($rs_topo);

mysql_free_result($rs_present);

mysql_free_result($rs_future);

mysql_free_result($rs_maximo);

mysql_free_result($rs_titulo);
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.