PDA

View Full Version : IE runtime error line 1 syntax error



ghostz00
Jun 20th, 2007, 06:33 PM
Firefox doesn't give me any errors at all. I have no clue which script it is I have 2 externals.

top part of my xhtml


<?php
session_start();
include_once("./php/class.db.php");
include_once("./php/class.salesmen.php");
include_once("./php/class.calendar.php");
?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>P&amp;W Millworks Scheduling</title>
<link rel="stylesheet" type="text/css" media="screen" href="./css/pwshipping.css" />
<script type="text/javascript" src="./javascript/items.js"></script>
<script type="text/javascript" src="./javascript/ajax.js"></script>
</head>

<body onload="javascript:startup()">

top of my items.js script


var totalItems = 0; //count of how many items there are currently

function startup(){
document.forms[0].elements["wo"].focus();
document.getElementById("items").innerHTML="QTY: <input type='text' size='3' onkeypress='javascript:return newItem(event)' name='qty"+totalItems+"' />"+
"ITEM: <input type='text' size='10' onkeypress='javascript:return newItem(event)' name='item"+totalItems+"' />"+
"TYPE: <select name='type"+totalItems+"'>"+
"<option value='prodoors'>Production Doors</option>"+
"<option value='specdoors'>Special Doors</option>"+
"<option value='treads'>Treads</option>"+
"<option value='mould' selected>Mouldings</option>"+
"<option value='prehang'>Prehang</option>"+
"<option value='cnc'>CNC</option>"+
"</select>"+
"DESC: <input type='text' size='15' onkeypress='javascript:return newItem(event)' name='desc"+totalItems+"' />"+
"DATE: <input type='text' size='8' onkeypress='javascript:return newItem(event)' name='itemDate"+totalItems+"' />"+
"<input type='button' value=Delete name='del0' disabled onclick='javascript:loadText('0')' />"+
"<input type='hidden' name='id' value='0' /><br />";
totalItems=1;
}


and top part of my ajax.js


var xmlHttp;

function checkCustomer(customer){

var url="./php/checkcustomers.php?cust="+customer;

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null){
alert ("Your browser does not support AJAX!");
return;
}

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

Any Input?

thanks in advance!

ghostz00
Jun 20th, 2007, 09:39 PM
Ok so I narrowed it down a bit to this piece of code.


document.getElementById("items").innerHTML="QTY: <input type='text' size='3' onkeypress='javascript:return newItem(event)' name='qty"+totalItems+"' />"+
"ITEM: <input type='text' size='10' onkeypress='javascript:return newItem(event)' name='item"+totalItems+"' />"+
"TYPE: <select name='type"+totalItems+"'>"+
"<option value='prodoors'>Production Doors</option>"+
"<option value='specdoors'>Special Doors</option>"+
"<option value='treads'>Treads</option>"+
"<option value='mould' selected>Mouldings</option>"+
"<option value='prehang'>Prehang</option>"+
"<option value='cnc'>CNC</option>"+
"</select>"+
"DESC: <input type='text' size='15' onkeypress='javascript:return newItem(event)' name='desc"+totalItems+"' />"+
"DATE: <input type='text' size='8' onkeypress='javascript:return newItem(event)' name='itemDate"+totalItems+"' />"+
"<input type='button' value=Delete name='del0' disabled onclick='javascript:loadText('0')' />"+
"<input type='hidden' name='id' value='0' /><br />";


Any Ideas?

_Aerospace_Eng_
Jun 20th, 2007, 09:43 PM
Change this

onclick='javascript:loadText('0')'
to this

onclick='loadText(\"0\")'

ghostz00
Jun 20th, 2007, 09:49 PM
That was it!

Thank you very much.

I must have starred at that code for what seemed like forever.