Page 1 of 1

Ajax code not working in internet explorer

Posted: Thu May 28, 2009 11:59 pm
by kushaljutta
i have some problems using internet explorer

here im sending code it was working in all browser expect IE...can you help me anyone



this is index.php

Code: Select all

 
<html>
<head>
<script type="text/javascript">
function table()
 
{
    url="tableres.php?pos";
    url=encodeURI(url);
ajaxpage(url,'result');
 
 }
  function login(showhide){
  // alert(showhide);
    if(showhide == "show"){
    //alert('in show');
        document.getElementById('popupbox').style.visibility="visible"; /* If the function is called with the variable 'show', show the login box */
    }else if(showhide == "hide"){
    //alert('in else show');
    
        document.getElementById('popupbox').style.visibility="hidden"; /* If the function is called with the variable 'hide', hide the login box */
        
         
    }
  } 
</script>
</head>
<body>
 <table width="580" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left"><a href="javascript&#058;login('show');" ><img src="images/public.gif"></a><a href="javascript&#058;login1('hide');" ><img src="images/private.gif"></a></td>
    </tr>
</table>
<div id="popupbox" style="visibility:hidden"> <!--Start login box-->
 
  <table width="543" height="33" cellpadding="0" cellspacing="0" >
         <tr>
         <td width="181" align="left" background="images/front.gif" style="background-repeat:no-repeat" ><a href="#" class="style7" onClick="table();">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SINGLE</a></td>
      <td width="181"  align="left" background="images/front.gif" style="background-repeat:no-repeat"><a href="javascript&#058;login1('hide')" class="style7" nClick="table1();">101 TOURNMENT</a></td>
     <td width="181"  align="left"  background="images/front.gif" style="background-repeat:no-repeat"><a href="javascript&#058;login1('hide');" class="style7">250 TOURNMENT</a></td>
     </tr>
     <table width="560" border="0" cellpadding="0" cellspacing="0" class="style8">
  <tr>
    <td width="20" class="r_r">TableID</td>
    <td align="center" class="r_r" >Stake</td>
    <td align="left"class="r_r" >Bet</td>
    <td align="center" class="r_r">Players</td>
    <td class="r_r" ><div align="center">Status</div></td>
    <td align="center" class="r_r" >Image</td>
  </tr>
  </table>
  <table width="550" cellpadding="0" border="0">
 <tr ><script type="text/javascript">
refreshdiv();
</script>
[b]<div style="overflow:auto; padding-left:7px; height:300px; width:580px" id="result">
 //here we can see the result of anoher php page
    </div>[/b]
  </tr>
</table>
</table>
</div>
</body>
</html>
 
//tableres.php
 
<link href="form_data.css" rel="stylesheet" type="text/css" />
   <style type="text/css">
<!--
.style1 {color: #000000}
.field-text style1 img {
    text-decoration: none;
}
-->
   </style>
<table align="center">
  <?php
  include 'class/rr_class.php';
  ini_set("session.save_path","./sessions");
                @session_start();
                $user=$_SESSION['username'];
                $userid=$_SESSION['id'];
 
  
  if(isset($_REQUEST['pos']))
  {
 
$sql="select * from maintable";
$result=mysql_query($sql);
 
?>
<table width="570" border="0" cellpadding="0" cellspacing="0" align="left" class="style8">
 
  <?php
                $color=1;
                while($rows=mysql_fetch_array($result))
                {
                 if($rows['tid']<10)
                   {
            $rows['tid']=str_pad($rows['tid'],2,'0',STR_PAD_LEFT);
                  }
                $tbid=$rows['tid'];
                if($color==1)
                {
                $_SESSION['tid']=$rows['tid'];
                            ?>
        <tr  bgcolor="#CCCCCC">
        <td width="55" align="center" class="field-text"><span class="style1"><?php echo "Table"." ".$rows['tid'];?></span></td>
        <td width="55"  class="field-text"  align="right"><span class="style1"><?php echo $rows['stake'];?></span></td>
        <td width="101" class="field-text" align="center"><span class="style1"><?php echo $rows['bet']; ?></span></td>
        <td width="97"  class="field-text" align="right"><span class="style1"><?php echo $rows['playertype'];?></span></td>
        <?php 
        if($rows['playertype']=="two 
 
players"){?>
        <td width="104" class="field-text" align="right" ><span class="style1">
        <?php 
        $sql1="select sum(status) from game_table where tableid='$tbid'";
$result1=mysql_query($sql1);
$dta=mysql_fetch_array($result1);
$status=$dta[0];
if($status==0)
echo "0/2";
if($status==1)
echo $status."/2";
if($status==2)
echo $status."/2";
        ?>
        </span></td>
        <td width="138"  class="field-text style1" valign="middle">
        <?php 
        if($status==2)
        echo "<a href='#'><img src='admins/images/fill.jpg' align='right'/></a>";
        else
        {?>
           <a href="test.php?userid=<?php echo $userid;?>&table=<?php echo $tbid;?>"><img src="admins/images/join.jpg" align="right" border="0"/></a>
        <?php }?>       </td>
        
        <?php }else{?>
        <td width="104" class="field-text" align="right" ><span class="style1">
        <?php 
        $sql1="select sum(status) from game_table where tableid='$tbid'";
$result1=mysql_query($sql1);
$dta=mysql_fetch_array($result1);
$status=$dta[0];
if($status==0)
echo "0/4";
if($status==1)
echo $status."/4";
if($status==2)
echo $status."/4";
if($status==3)
echo $status."/4";
if($status==4)
echo $status."/4";
        ?>
        </span></td>
        <td width="138"  class="field-text style1" valign="middle">
        <?php 
        if($status==4)
        echo "<a href='#'><img src='admins/images/fill.jpg' align='right'/></a>";
        else
        {?>
           <a href="4test.php?userid=<?php echo $userid;?>&table=<?php echo $tbid;?>"><img src="admins/images/join.jpg" align="right" border="0"/></a>
        <?php }?>       </td>
        <?php }?>
 </tr>
  <?php 
  $color=2;
    } 
    else
    {?>
        <tr  bgcolor="#999999">
        <td class="field-text" align="center"><span class="style1"><?php echo "Table"." ".$rows['tid'];?></span></td>
        <td  class="field-text" align="right" ><span class="style1"><?php echo $rows['stake'];?></span></td>
        <td  class="field-text" align="center"><span class="style1"><?php echo $rows['bet']; ?></span></td>
        <td class="field-text" align="right"><span class="style1"><?php echo $rows['playertype'];?></span></td>
       <?php 
        if($rows['playertype']=="two 
 
players"){?>
        <td width="104" class="field-text" align="right" ><span class="style1">
        <?php 
        $sql1="select sum(status) from game_table where tableid='$tbid'";
$result1=mysql_query($sql1);
$dta=mysql_fetch_array($result1);
$status=$dta[0];
if($status==0)
echo "0/2";
if($status==1)
echo $status."/2";
if($status==2)
echo $status."/2";
        ?>
        </span></td>
        <td width="138"  class="field-text style1" valign="middle">
        <?php 
        if($status==2)
        echo "<a href='#'><img src='admins/images/fill.jpg' align='right'/></a>";
        else
        {?>
           <a href="test.php?userid=<?php echo $userid;?>&table=<?php echo $tbid;?>"><img src="admins/images/join.jpg" align="right" border="0"/></a>
        <?php }?>       </td>
        
        <?php }else{?>
        <td width="104" class="field-text" align="right" ><span class="style1">
        <?php 
        $sql1="select sum(status) from game_table where tableid='$tbid'";
$result1=mysql_query($sql1);
$dta=mysql_fetch_array($result1);
$status=$dta[0];
if($status==0)
echo "0/4";
if($status==1)
echo $status."/4";
if($status==2)
echo $status."/4";
if($status==3)
echo $status."/4";
if($status==4)
echo $status."/4";
        ?>
        </span></td>
        <td width="138"  class="field-text style1" valign="middle">
        <?php 
        if($status==4)
        echo "<a href='#'><img src='admins/images/fill.jpg' align='right'/></a>";
        else
        {?>
           <a href="4test.php?userid=<?php echo $userid;?>&table=<?php echo $tbid;?>"><img src="admins/images/join.jpg" align="right" border="0" /></a>
        <?php }?>       </td>
        <?php }?>
        </td>
  </tr>
  <?php   $color=1;} 
 
    
    
  
 
}
    }
    
  ?>
</table>
 

please help me

Re: Ajax code not working in internet explorer

Posted: Fri May 29, 2009 4:36 pm
by califdon
Actually, I don't see any Ajax code there. You seem to be missing all of the Javascript code that makes Ajax work. Read some basic tutorials on Ajax, like http://www.captain.at/howto-ajax-process-xml.php