petey20
03-14-2005, 05:04 PM
I have this online editor that works like a charm in IE 6 but it is not working correctly in I.E. 5.2 or the latest Firefox. I'm getting a couple errors in the Java Consol in firefox which I'm assuming is the problem. Would anyone be interested in helping me debug this? I'm spinning my wheels on this big time.
On of the errors is saying that WriteMenuItems is not declared. It's a Javascript function I have in an included JS file. Not too sure why it works great in IE 6 but it sure doesn't in the older versions.
<?
if ( $_COOKIE['auth'] == "" && $use_cookies == TRUE ){
die ("You are not authorized to view this page. 404.");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="robots" content="noindex,nofollow">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>Flyspeck - Edit</title>
<link href="includes/flyspeck_css.css" rel="stylesheet">
<script type="text/javascript" src="includes/flyspeck_js.js"></script>
<script type="text/javascript" language="Javascript1.2">
_editor_url = "htmlarea/"; // URL to htmlarea files
_editor_field = "";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
var MyBgColor ='#FFFFFF';
var MyBgImg ='';
</script>
<script>
function updateAttributes(){
document.myform.bgcolor.value=MyBgColor;
document.myform.background.value=MyBgImg;
}
</script>
<STYLE TYPE="text/css">
.headtext { font-size:10pt;font-weight:bold; }
TD, DIV {font:9pt Verdana,Arial, Helvetica, sans-serif;}
</STYLE>
</head>
<body onload="goContext(); javascript:hide();">
<?php
require "includes/config.php";
include "includes/header.php";
GLOBAL $absPath, $id;
// Declare Variables for the entire page.
$id = $HTTP_GET_VARS["id"];
$absPath = $HTTP_GET_VARS["absPath"];
$relPath = $HTTP_GET_VARS["relPath"];
echo debugMe( "The ID is " . $id . "<br>\n");
echo debugMe( "The absPath is " . $absPath . "<br>\n");
echo debugMe( "The relPath is " . $relPath . "<br>\n");
$editContent = findContent ($absPath, $id);
?>
<textarea name="editorarea" cols="" rows="" style="width:97%; height:250;"><?=$editContent?></textarea>
<form action="saveme.php" name="contentHolder" method="post" <? if ($debug != TRUE) {echo "style=display:none";}?> >
<b>Debugging Information</b> <em>You must hit submit in debugging mode!</em><br>
<hr>
Editable ID: <input type="text" name="id" value=<?=$id?>><br>
Absolute Path (absPath):<input type="text" name="absPath" size="50" value="<?=$absPath?>"><br>
Relative Path (relPath) : <input type="text" name="relPath" size="50" value="<?=$relPath?>"><br>
NewContent Holder:<textarea name="newContent" rows="4" cols="40"></textarea><br>
<button type="submit">Submit</button>
</form>
<?=$footer;?>
</body>
<script language="JavaScript1.2">
var config = new Object(); // create new config object
config.width = "100%";
config.height = "75%";
config.bodyStyle = 'background-color: white; font-size: xsmall;';
config.debug = 0;
<? if ($csspath != "") { ?>
config.stylesheet = "<?=$csspath?>";
<?}?>
// Add additional editor config settings here...
var relPath = "<?=$relPath?>";
editor_generate('editorarea',config);
WriteMenuItems('editorarea');
</script>
</html>
On of the errors is saying that WriteMenuItems is not declared. It's a Javascript function I have in an included JS file. Not too sure why it works great in IE 6 but it sure doesn't in the older versions.
<?
if ( $_COOKIE['auth'] == "" && $use_cookies == TRUE ){
die ("You are not authorized to view this page. 404.");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="robots" content="noindex,nofollow">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>Flyspeck - Edit</title>
<link href="includes/flyspeck_css.css" rel="stylesheet">
<script type="text/javascript" src="includes/flyspeck_js.js"></script>
<script type="text/javascript" language="Javascript1.2">
_editor_url = "htmlarea/"; // URL to htmlarea files
_editor_field = "";
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
var MyBgColor ='#FFFFFF';
var MyBgImg ='';
</script>
<script>
function updateAttributes(){
document.myform.bgcolor.value=MyBgColor;
document.myform.background.value=MyBgImg;
}
</script>
<STYLE TYPE="text/css">
.headtext { font-size:10pt;font-weight:bold; }
TD, DIV {font:9pt Verdana,Arial, Helvetica, sans-serif;}
</STYLE>
</head>
<body onload="goContext(); javascript:hide();">
<?php
require "includes/config.php";
include "includes/header.php";
GLOBAL $absPath, $id;
// Declare Variables for the entire page.
$id = $HTTP_GET_VARS["id"];
$absPath = $HTTP_GET_VARS["absPath"];
$relPath = $HTTP_GET_VARS["relPath"];
echo debugMe( "The ID is " . $id . "<br>\n");
echo debugMe( "The absPath is " . $absPath . "<br>\n");
echo debugMe( "The relPath is " . $relPath . "<br>\n");
$editContent = findContent ($absPath, $id);
?>
<textarea name="editorarea" cols="" rows="" style="width:97%; height:250;"><?=$editContent?></textarea>
<form action="saveme.php" name="contentHolder" method="post" <? if ($debug != TRUE) {echo "style=display:none";}?> >
<b>Debugging Information</b> <em>You must hit submit in debugging mode!</em><br>
<hr>
Editable ID: <input type="text" name="id" value=<?=$id?>><br>
Absolute Path (absPath):<input type="text" name="absPath" size="50" value="<?=$absPath?>"><br>
Relative Path (relPath) : <input type="text" name="relPath" size="50" value="<?=$relPath?>"><br>
NewContent Holder:<textarea name="newContent" rows="4" cols="40"></textarea><br>
<button type="submit">Submit</button>
</form>
<?=$footer;?>
</body>
<script language="JavaScript1.2">
var config = new Object(); // create new config object
config.width = "100%";
config.height = "75%";
config.bodyStyle = 'background-color: white; font-size: xsmall;';
config.debug = 0;
<? if ($csspath != "") { ?>
config.stylesheet = "<?=$csspath?>";
<?}?>
// Add additional editor config settings here...
var relPath = "<?=$relPath?>";
editor_generate('editorarea',config);
WriteMenuItems('editorarea');
</script>
</html>