View Full Version : Reload

12-05-2008, 10:48 PM
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.

<!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">
<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" />
<!--[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;

intImage = 2;
function swapImage() {
switch (intImage) {
case 1:
IMG1.src = "images/check.jpg"
intImage = 2
case 2:
IMG1.src = "http://msdn.microsoft.com/msdn-online/start/images/msdn-logo.gif"
intImage = 1

<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;

<body bgcolor="#eeffdd">
<center><img src="images/NYLS_This_Week_logo.gif"/></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 />
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
while($myrow = mysql_fetch_array($result)) {
$dateTime = new DateTime($dtime);
$dtime = date_format($dateTime, "m-d-Y h:i:s");
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>";
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">
$positionquery = mysql_query("UPDATE news SET position = '$i' where newsid = '$newsid'");
<a href="review.php"><img src="images/save.jpg" height="25px" width="25px" border='0' />Publish</a></center>

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>";

12-05-2008, 11:50 PM
Your HTML does not validate, which can cause any number of problems.

VALIDATE (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Foit.nyls.edu%2Fthisweek%2F)

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.

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