Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Reload

  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reload

    So, say i have this site http://oit.nyls.edu/thisweek. Open it up in Firefox, click on the move up button it works. Now open it up IE, click on the move button, it doesnt work. Why? How is this fixed.

    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=utf-8" />
    <title>NYLS This Week</title>
    <link href="thisweek.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
        <link rel="stylesheet" type="text/css" href="thisweekie.css" "screen" />
    <![endif]-->
    <!--[if i2]><meta http-equiv="refresh" content="0;URL=http://oit.nyls.edu/thisweek/ie"><![endif]-->
    <script type="text/javascript" src="scriptaculous/lib/prototype.js"></script>
    <script type="text/javascript" src="scriptaculous/src/scriptaculous.js"></script>
    <script src="selectuser.js"></script>
    
    <script type="text/javascipt">
    function handleResponse() {
      if (http.readyState == 4 && http.status == 200) {
        var response = http.responseText;
        var update = new Array();
    
        if (response.indexOf('|') != -1) {
          update = response.split('|');
          updatePage(update[0], update[1]);
        }
      }
    }
    
    function updatePage(div, text) {
      var viewer = document.getElementById(div);
      viewer.innerHTML = text;
    }
    
    function updateImage(img, text) {
      var image = document.getElementById(img);
      image.src = text;
    </script>
    
    <SCRIPT LANGUAGE=JavaScript>
    intImage = 2;
    function swapImage() {
    switch (intImage) {
     case 1:
       IMG1.src = "images/check.jpg"
       intImage = 2
       return(false);
    case 2:
       IMG1.src = "http://msdn.microsoft.com/msdn-online/start/images/msdn-logo.gif"
       intImage = 1
       return(false);
     }
    }
    </SCRIPT>
    
    <script language="javascript">
    function switch1(div) {
    if (document.getElementById('one')) {
    var option=['one','two','three'];
    for(var i=0; i<option.length; i++) 
    { obj=document.getElementById(option[i]);
    obj.style.display=(option[i]==div)? "block" : "none"; }
    }
    }
    //
    function switchImg(i){
    document.images["newsstatus"].src = i;
    }
    </script>
    
    </head>
    <body bgcolor="#eeffdd">
    <center><img src="images/NYLS_This_Week_logo.gif"/></center>
    <center>
    <div id="header">
    <img src=images/plus.gif width='20px' height='20px' border='0'/>Add News Item <a href="addnews.php"> [click here]</a><br />
    <img src=images/minus.gif width='20px' height='20px' border='0'/>Delete News Item <a href="deletenews.php"> [click here]</a><br />
    </div>
    </center>
    <?php
    include ("connect.php");
    $query = "select * from news ORDER BY position ASC";
    $status = mysql_query("SELECT status FROM news WHERE one='1' ORDER BY position");
    $myrow = mysql_fetch_array($status);
    $result = mysql_query($query);
    $num = mysql_num_rows($result);
    $dtime = $_GET['dtime'];
    $statusquery = mysql_query("UPDATE news SET status = '0' where title = '$title'");
    $statusquery2 = mysql_query("UPDATE news SET status = '1' where title = '$title'");
    
    if (($result)||(mysql_errno == 0))
    {
      echo "<table width='70%' align='center' border='2' cellpadding='2' cellspacing='2' class='sortable' bgcolor='#FEE7C2'><tr>";
      if ($num > 0)
      {
              //loop thru the field names to print the correct headers
              
           {
    	   //echo "<td bgcolor='#CCC' align='center'><strong>Position</strong></td>";
           echo "<td bgcolor='#568cc1' width='20%' align='center'><strong>Date Post</strong></td>";
    	   echo "<td bgcolor='#568cc1' align='center'><strong>Title</strong></td>";
    	   echo "<td bgcolor='#568cc1' width='5%'align='center'><strong>Activate</strong></td>";
    	   echo "<td bgcolor='#568cc1' width='5%' align='center'><strong>Edit</strong></td>";
    	   echo "<td bgcolor='#568cc1' width='8%' align='center'><strong>Move</strong></td>";
    	   
        }
        echo "</tr>";
       
        //display the data
        $i=0;
    	while($myrow = mysql_fetch_array($result)) {
    	$dtime=mysql_result($result,$i,"dtime");
    	$newsid=mysql_result($result,$i,"newsid");
    	$title=mysql_result($result,$i,"title");
        $status=mysql_result($result,$i,"status");
    	$position=mysql_result($result,$i,"position");
    	$dateTime = new DateTime($dtime);
    	putenv("TZ=US/Eastern");
    	$dtime = date_format($dateTime, "m-d-Y h:i:s");
    	?>
        <?php
        echo "<tr>";
    	//echo "<td align='center'>$position</td>";	
    	echo "<td align='center'>$dtime</td>";
    	echo "<td align='center'>$title</td>";
    	if ($status > 0)
    	{
    	echo "<td align='center'><a href='' alt = '$newsid' OnClick=\"parent.location='statusquery.php?newsid=$myrow[newsid]'\"><img src=images/check.jpg width='20px' height='20px' border='0'/></a></td>";
    	}
    	else
    	{
    	echo  "<td align='center'><a href='' alt = '$newsid' OnClick=\"parent.location='statusquery2.php?newsid=$myrow[newsid]'\"><img src=images/x.gif width='20px' height='20px' border='0'/></a></td>";
    	}
    	echo "<td align='center'><a href='result.php?newsid=$myrow[newsid]'><img src=images/edit.jpg border='0'></a></td>";
    	echo "<td align='center'><a href='' alt = '$newsid' OnClick=\"parent.location='move.php?newsid=$myrow[newsid]'\"><img src=images/up_arrow.gif width='20px' height='20px' border='0'/></a><a href='' alt = '$newsid' OnClick=\"parent.location='movedown.php?newsid=$myrow[newsid]'\"><img src=images/down_arrow.gif width='20px' height='20px' border='0'/></a></td>";
    	echo "</tr>";
    	?>
        <script type="text/javascript">
            Sortable.create('news_list');
            </script>
        <?php
    $i++;
    $positionquery = mysql_query("UPDATE news SET position = '$i' where newsid = '$newsid'");
    }
    }
    }
    ?>
    </table>
    <center>
    <a href="review.php"><img src="images/save.jpg" height="25px" width="25px" border='0' />Publish</a></center>
    <style>
    a:link
    {
    text-decoration:none;
    }
    a:visited
    {
    text-decoration:none;
    }
    </style>
    </body>
    </html>
    Code:
    move.php
    <?php
    include ("connect.php");
    $update= $_GET['newsid'];
    $movequery = mysql_query("UPDATE news SET position =  position - 1.3 WHERE newsid = '$update'");
    echo "<meta http-equiv = Refresh content=1;url=http://oit.nyls.edu/thisweek/index.php>";
    ?>

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Your HTML does not validate, which can cause any number of problems.

    VALIDATE

    FF reports Javascript errors, but still manages to get 'er done. I guess IE isn't as good at getting through the errors. Quite frankly the script shouldn't work in any browser.

    Code:
    Error: element is null
    Source File: http://oit.nyls.edu/thisweek/scriptaculous/src/dragdrop.js
    Line: 600


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •