polcat — 2012-08-21T16:31:57-04:00 — #1
Hello! I am having some trouble getting my information to show up.
At first it shows the table with the information, and then it shows a syntax error, and the information I just entered to be a document ready command.
All of the information I have, except for the table, is coming from the book pg. 20 of the second edition, but I can't figure out what I am doing wrong.
When I view this code in a browser while having a syntax error, I cannot see anything.
And when I do not have an error, I get the code that I just entered stuck in my webpage at the top.
Here is the entire code that I am having trouble with.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Cake Kiosk</title>
alert('Welcome to StarTrackr! Now no longer under police investigation!');
<table width="100%" border="2" cellspacing="2" cellpadding="2" bgcolor="#0066FF">
<td colspan="2" align="center">The Cake Kiosk</td>
<td align="center">Design Your Own</td>
<td align="center">Current Designs</td>
<td align="center">Java Script Code Left</td>
<td align="center">Java Script Code Right</td>
<td align="center" colspan="2">Developed by Kiosks for Cakes</td>
Thank you for your time!
aussiejohn — 2012-08-21T17:35:45-04:00 — #2
If you were to place your $(document).ready() block in to script.js or wrap it with script tags, it should work
polcat — 2012-08-22T10:09:52-04:00 — #3
YES! Thank you so very much!!!! I put into the end of the script.js tag first, and it didn't do anything except take the line off the actual webpage. Then I put it into it's own script tags and it worked just fine. I am assuming that because I put it in <script> tags that it treated it as script?
cpradio — 2012-08-22T10:12:10-04:00 — #4
Yes, your assumption is correct.
polcat — 2012-08-22T13:35:41-04:00 — #5
sweet! this is so much fun! getting it wrong and then fixing it is just as much fun as getting it right the first time!