Uncaught Exception

Node cannot be inserted

Page 1 of 1

0 Replies - 507 Views - Last Post: 18 April 2010 - 01:15 PM

#1 dispatch4599  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 19
  • Joined: 21-February 10

Uncaught Exception

Posted 18 April 2010 - 01:15 PM

Yes, I'm a noob but in need of some help regrading exceptions. I also could use some guidance.

This is my code to create a form which shows a picture of the product, the product price, description, etc. I guess my biggest question is why am I getting the error and how do I correct it?

The second question would be, why is only the first image appearing? Any advice would be helpful.

<!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" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>Products- Index</title>

	<script src="products.js" type="text/javascript" charset="utf-8"></script>

	<script type="text/javascript" charset="utf-8">
	var qs = document.location.search.substring( 1, document.location.search.length );
	var pair = qs.split( "=" );

		window.onload = function( ) {

			for( var x = 0 ; x < products.length ; x++ ) {
					var table = document.createElement("table");
					var title_tag = document.getElementById( "title" );
					var holder_tag = document.getElementById( "holder" );
					var description_tag = document.getElementById( "description" );
					var price_tag = document.getElementById ("price");
					var row = document.createElement("tr");
					var data = document.createElement("td");


					title_tag.appendChild( document.createTextNode( products [ x ].title ) );
					price_tag.appendChild( document.createTextNode( products [ x ].price ) );
					description_tag.appendChild( document.createTextNode( products [ x ].description ) );

					var image_tag = document.createElement( "img" );
					image_tag.src = "images/" + products [ x ].name + "_thumb.jpg";

					var a = document.createElement( "a" );
					a.href = "product_view.html?image=" + products [ x ].name ;

					a.appendChild( image_tag );
					data.appendChild( a );
					row.appendChild(data);
					table.appendChild(row);
					holder_tag.appendChild(table);

					data.appendChild (title_tag);
					row.appendChild (data);
					table.appendChild(row);
					title_tag.appendChild( table);

					data.appendChild(price_tag);
					row.appendChild (data);
					table.appendChild(row);
					price_tag.appendChild( table);

					data.appendChild(description_tag);
					row.appendChild(data);
					table.appendChild(row);
					description_tag.appendChild( table);


				}
			}

	</script>

</head>

<body>

	<h1>Products - Index</h1>
	<form method='POST' target='_top' action="orderForm2.html">

		<h2 id="title"></h2>

		<div id="holder"></div>
			<h2 id = "price"></h2>
			<p id="description"></p>
		 <input type='checkbox' name='Products'>Add to Order</input></td>



	<p><input type = 'submit' value = "Submit Order"/></p>

</form>

</body>
</html>



Is This A Good Question/Topic? 0
  • +

Page 1 of 1