deanosrs
01-16-2006, 03:06 PM
Hi,
Whenever I test my dhtml form verification page (using javascript) on my local server, it tells me there's been an error running the scripts on the page and gives an option as to whether or not I want to continue. It says unexpected string on line 13 char 1. Would this refer to my html file, or any of the javascript/php files I have linked to within it?!
It basically results in IE not running the form verification whereas Firefox will. I think it might be something to do with the php scripts or html in hindsight because it works fine when I isolate the html for the form along with the javascript links in a test document. I'll put my html here for reference...:
<!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=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="skins/default/styles_blog.css" />
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:473px;
z-index:1;
left: 85px;
top: 43px;
border: thin solid #000000;
background: #9A4766;
}
-->
</style>
<script type="text/javascript" src="include/javascript/exampleValidation.js"></script>
<script type="text/javascript" src="include/javascript/genericValidation.js"></script>
</head>
<body>
<div id="Layer1"> <a href="index.php">Blog Index</a><br />
<?php
include "include/func.php";
include "include/blog.php";
?>
</div>
</body>
</html>
The actual form itself is generated by the php files. This is the html that the php displays as view source:
<!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=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="skins/default/styles_blog.css" />
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:473px;
z-index:1;
left: 85px;
top: 43px;
border: thin solid #000000;
background: #9A4766;
}
-->
</style>
<script type="text/javascript" src="include/javascript/exampleValidation.js"></script>
<script type="text/javascript" src="include/javascript/genericValidation.js"></script>
</head>
<body>
<div id="Layer1"> <a href="index.php">Blog Index</a><br />
<br /><table class="blog_display_table">
<tbody>
<tr>
<td rowspan="5" class="blog_display_left"> </td>
<td class="blog_display_header">02:28 JANUARY 12TH</td>
<td rowspan="5" class="blog_display_right"> </td>
</tr>
<tr>
<td class="blog_display_title">until february....</td>
</tr>
<tr>
<td class="blog_display_header">TUNE: BUT THEN AGAIN NO // SHOUT OUT LOUDS</td>
</tr>
<tr>
<td class="blog_display_content">We'll I'm just going to tidy some more stuff up tonight in the output of the code so far, then I'm stopping work on this site for a while, although I'll probably post a few blogs here and there, because I just worked out a way to see the next CS coursework so I'm going to get ahead of the game with that.
<br />
<br />This blog is more than functional although there's a few more things I have planned, like checking the form input for adding a comment before you hit the submit button - so if you accidently leave the name section blank, for instance, it tells you before you hit submit meaning you don't have to go back and forth between pages. It sounds like a really small thing, but I have to learn a whole new language to do it (it's A-synchronous JavaScript and XML, aka AJAX for those who care!).
<br />
<br />That c/w is due in on the 21st... then the week after is revision time for maths and psychology, and the week after that pyschology essay time. That takes me through 'til the end of February, so hopefully I'll have some more time then when the next teaching block starts to finish off this site.
<br />
<br />So to writing a program that analyses Dicken's A Christmas Carol it is. Don't ask.</td>
</tr>
<tr>
<td class="blog_display_content"></td>
</tr>
</tbody>
</table><br /><form method="post" action="index.php?action=add_comment&submit=TRUE"><table width="100%" class="blog_display_table">
<tbody>
<tr>
<td rowspan="6" class="blog_display_left"> </td>
<td class="comments_title">Add a comment for this blog entry:</td>
<td rowspan="6" class="blog_display_right"> </td>
</tr>
<tr>
<td><p>Your Name:<br />
<input name="name" type="text" id="name" size="60" maxlength="40" class="form" value="" /><br /><span id="error_name" class="errormessage"></span></p>
<p>Comment:<br />
<textarea name="comment" id="name" cols="57" rows="5" class="form"></textarea><br /><span id="error_comment" class="errormessage"></span></p>
<input type="hidden" name="id" value="7" />
<input type="submit" name="Submit" value="Submit" class="form" /></td>
</tr>
</tbody></table></form><br /><table width="100%" class="blog_display_table">
<tbody>
<tr>
<td rowspan="2" class="blog_display_left"> </td>
<td class="blog_display_header"><span class="comments_title">Comments (newest first):</span></td>
<td rowspan="2" class="blog_display_right"> </td>
</tr>
<tr> <td><table width="100%" class="comment_specific_display"><tr>
<td><span class="blog_display_header">Posted by SHEPS "QUOTES" 'MORE' on 16TH JANUARY 14:25</span>
</td></tr>
<tr><td>
Did I hack you? <strong>test</strong>
<br /><b>test</b></td></tr></table><table width="100%" class="comment_specific_display"><tr>
<td><span class="blog_display_header">Posted by SHEPS on 16TH JANUARY 13:59</span>
</td></tr>
<tr><td>
gdregwergwsgtwrger</td></tr></table><table width="100%" class="comment_specific_display"><tr>
<td><span class="blog_display_header">Posted by SHEPS on 12TH JANUARY 03:12</span>
</td></tr>
<tr><td>
Just one final test...</td></tr></table></td></tr></tbody>
</table><br /></div>
</body>
</html>
Thanks so much for any help. Not really a problem I know how to go about fixing as I don't know whether to look in the html, of which line 13 is just css, php files or what! I know it's not the javascript files though, because they run fine from another html page.
Whenever I test my dhtml form verification page (using javascript) on my local server, it tells me there's been an error running the scripts on the page and gives an option as to whether or not I want to continue. It says unexpected string on line 13 char 1. Would this refer to my html file, or any of the javascript/php files I have linked to within it?!
It basically results in IE not running the form verification whereas Firefox will. I think it might be something to do with the php scripts or html in hindsight because it works fine when I isolate the html for the form along with the javascript links in a test document. I'll put my html here for reference...:
<!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=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="skins/default/styles_blog.css" />
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:473px;
z-index:1;
left: 85px;
top: 43px;
border: thin solid #000000;
background: #9A4766;
}
-->
</style>
<script type="text/javascript" src="include/javascript/exampleValidation.js"></script>
<script type="text/javascript" src="include/javascript/genericValidation.js"></script>
</head>
<body>
<div id="Layer1"> <a href="index.php">Blog Index</a><br />
<?php
include "include/func.php";
include "include/blog.php";
?>
</div>
</body>
</html>
The actual form itself is generated by the php files. This is the html that the php displays as view source:
<!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=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="skins/default/styles_blog.css" />
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:473px;
z-index:1;
left: 85px;
top: 43px;
border: thin solid #000000;
background: #9A4766;
}
-->
</style>
<script type="text/javascript" src="include/javascript/exampleValidation.js"></script>
<script type="text/javascript" src="include/javascript/genericValidation.js"></script>
</head>
<body>
<div id="Layer1"> <a href="index.php">Blog Index</a><br />
<br /><table class="blog_display_table">
<tbody>
<tr>
<td rowspan="5" class="blog_display_left"> </td>
<td class="blog_display_header">02:28 JANUARY 12TH</td>
<td rowspan="5" class="blog_display_right"> </td>
</tr>
<tr>
<td class="blog_display_title">until february....</td>
</tr>
<tr>
<td class="blog_display_header">TUNE: BUT THEN AGAIN NO // SHOUT OUT LOUDS</td>
</tr>
<tr>
<td class="blog_display_content">We'll I'm just going to tidy some more stuff up tonight in the output of the code so far, then I'm stopping work on this site for a while, although I'll probably post a few blogs here and there, because I just worked out a way to see the next CS coursework so I'm going to get ahead of the game with that.
<br />
<br />This blog is more than functional although there's a few more things I have planned, like checking the form input for adding a comment before you hit the submit button - so if you accidently leave the name section blank, for instance, it tells you before you hit submit meaning you don't have to go back and forth between pages. It sounds like a really small thing, but I have to learn a whole new language to do it (it's A-synchronous JavaScript and XML, aka AJAX for those who care!).
<br />
<br />That c/w is due in on the 21st... then the week after is revision time for maths and psychology, and the week after that pyschology essay time. That takes me through 'til the end of February, so hopefully I'll have some more time then when the next teaching block starts to finish off this site.
<br />
<br />So to writing a program that analyses Dicken's A Christmas Carol it is. Don't ask.</td>
</tr>
<tr>
<td class="blog_display_content"></td>
</tr>
</tbody>
</table><br /><form method="post" action="index.php?action=add_comment&submit=TRUE"><table width="100%" class="blog_display_table">
<tbody>
<tr>
<td rowspan="6" class="blog_display_left"> </td>
<td class="comments_title">Add a comment for this blog entry:</td>
<td rowspan="6" class="blog_display_right"> </td>
</tr>
<tr>
<td><p>Your Name:<br />
<input name="name" type="text" id="name" size="60" maxlength="40" class="form" value="" /><br /><span id="error_name" class="errormessage"></span></p>
<p>Comment:<br />
<textarea name="comment" id="name" cols="57" rows="5" class="form"></textarea><br /><span id="error_comment" class="errormessage"></span></p>
<input type="hidden" name="id" value="7" />
<input type="submit" name="Submit" value="Submit" class="form" /></td>
</tr>
</tbody></table></form><br /><table width="100%" class="blog_display_table">
<tbody>
<tr>
<td rowspan="2" class="blog_display_left"> </td>
<td class="blog_display_header"><span class="comments_title">Comments (newest first):</span></td>
<td rowspan="2" class="blog_display_right"> </td>
</tr>
<tr> <td><table width="100%" class="comment_specific_display"><tr>
<td><span class="blog_display_header">Posted by SHEPS "QUOTES" 'MORE' on 16TH JANUARY 14:25</span>
</td></tr>
<tr><td>
Did I hack you? <strong>test</strong>
<br /><b>test</b></td></tr></table><table width="100%" class="comment_specific_display"><tr>
<td><span class="blog_display_header">Posted by SHEPS on 16TH JANUARY 13:59</span>
</td></tr>
<tr><td>
gdregwergwsgtwrger</td></tr></table><table width="100%" class="comment_specific_display"><tr>
<td><span class="blog_display_header">Posted by SHEPS on 12TH JANUARY 03:12</span>
</td></tr>
<tr><td>
Just one final test...</td></tr></table></td></tr></tbody>
</table><br /></div>
</body>
</html>
Thanks so much for any help. Not really a problem I know how to go about fixing as I don't know whether to look in the html, of which line 13 is just css, php files or what! I know it's not the javascript files though, because they run fine from another html page.