PDA

View Full Version : Thumbnail Viewer Javascript Runtime Error?



JMareel
02-01-2009, 06:44 PM
Hello everyone,

I am building my wife's website using FP 2003 and tried to put a great piece of javascript code I found at this site and used before with no problems, but now it is giving me problems. The java code I am speaking of is at this link
http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

I am not a newbie when it comes to website building and did exactly as the installation instructions said, which is the same as I did the first time I installed it on another website. But when I click "Preview" it gives me a "Runtime Error Line 1: Invalid character". When I "preview in browser" (IE 7) it opens the picture in another page which is not how the javascript is supposed to act. I checked the code, its placement, and even compared the code to the other page's code that worked and I am still at a loss. I also checked the page options in FP 2003 and javascript is checkedmarked Why is this error preventing me from incorporating this simple code into my website? :confused:

The code from the beginning of the page to the href that calls the java code to open the thumbnail below:


<html>
<head>
<link rel="stylesheet" href="thumbnailviewer.css" type="text/css" />

<script src="thumbnailviewer.js" type="text/javascript">

/***********************************************
* Image Thumbnail Viewer Script- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>


<body>

<div align="center">
&nbsp;<table border="1" width="929" id="table1" style="border-collapse: collapse">
<tr>
<td bgcolor="#F7AABB">
<p align="center">&nbsp;</td>
<td bgcolor="#F7AABB" align="center"><font face="Papyrus">Home</font></td>
<td bgcolor="#F7AABB" align="center"><font face="Papyrus">About Us</font></td>
<td bgcolor="#F7AABB" align="center"><font face="Papyrus">Policies</font></td>
<td bgcolor="#F7AABB" align="center"><font face="Papyrus">Shipping</font></td>
<td bgcolor="#F7AABB" align="center"><font face="Papyrus">Mailing
List</font></td>
<td bgcolor="#F7AABB" align="center"><font face="Papyrus">Links</font></td>
</tr>
<tr>
<td width="35%" bgcolor="#F7AABB" valign="top" rowspan="3"></p>
<p align="center">Our Products</p>
<p align="center"><span lang="en-us">Page1<br>
Page2<br>
Page3<br>
Page4<br>
Page5<br>
Page6<br>
Page7<br>
Page8<br>
Page9<br>
Page10</span></td></p>
<td width="22%" colspan="2" align="center" valign="top">
<a rel="thumbnail" href="images/beaniehat1.jpg">
<img src="images/beaniehat1.jpg" width="160" height="123" /></a><p>


Confused Developer,
JM

Snookerman
02-01-2009, 07:09 PM
Please post a link to the page on your site that contains the problematic script or attach your code so we can check it out and help you.

jscheuer1
02-02-2009, 04:40 AM
You should never preview in the editor, and when previewing in the browser, you should load the page directly into the browser - don't trust the editor to load it up properly.

In fact, when installing javascript, it is better to use a text only editor.

The behavior you are getting in the browser suggests that the script is not available to the page, or your links are not following the correct syntax (but that part looks OK). There could be more than one problem.

No way to be sure though without a link to your page.

JMareel
02-03-2009, 02:32 AM
jscheuer1,

Thank you for hinting at the previewing straight into browser because the script worked as it should :D. Its just one more step that I have grown out of that apparently I am going to have to make more standard in my website development. Previewing in FP was just an easy button click and has worked for the most part. Thanks again for the time taken out to review the code and suggestions. I hope I can return the favor and help in some way.

-JM