Forum Moderators: open

Message Too Old, No Replies

What's wrong with my script?

What's wrong?

         

adni18

12:08 am on Sep 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is wrong with this script?:

var base="my.url/";
document.write(base+"<nobr><center>");
document.write(base+"<b>-IronMagma-</b><br>");
document.write(base+"&#183;<a href=\""+base+"index.html\">Home</a>&#183;<br>");
document.write(base+"&#183;<a href=\"javascript:window.external.AddFavorite(\'http://www.ironmagma.tk\',\'IronMagma 3D Wallpaper\')\">Bookmark Now!</a>&#183;<br>");
document.write(base+"&#183;<a href=\""+base+"chat.html\">Chat Room</a>&#183;<br>");
document.write(base+"&#183;<a href=\""+base+"customize.html\">Customize</a>&#183;<br>");
document.write(base+"&#183;<a href=\""+base+"contact.html\">Contact</a>&#183;<br>");
document.write(&#183;<a href=\""+base+"copyright.html\">Copyright Info</a>&#183;<br>");
document.write("&#183;<a href=\""+base+"privacy.html\">Privacy Policy</a>&#183;");
document.write("<br><br><b>-Galleries-</b><br>");
document.write("&#183;<a href=\""+base+"galleries/securegallery.html\">Members Gallery</a>&#183;<br>");
document.write(&#183;<a href=\""+base+"galleries/grandlist.html\">Free Gallery</a>&#183;");
document.write("<br><br>&#183;<a href=\""+base+"cd.html\"><b>CD-ROM</b></a>&#183;<br><br>");
document.write("&#183;<a href=\"http://my.shop.shop\"><b>Shirts, etc.</a>&#183;</b><br><br>");
document.write("</nobr>")

Rambo Tribble

1:33 am on Sep 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your HTML character code should be within the quotes (it is, after all, HTML, not a variable). To easily find such errors, dump IE, get Mozilla or Firefox, and use the JavaScript Console (under Tools / Web Development). Took all of about .3 seconds.

adni18

11:45 am on Sep 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah, yes. The missing quotes. Thank you.

oceanwave

6:04 pm on Oct 1, 2004 (gmt 0)

10+ Year Member



Hi Rambo Tribble,

I took your advice and downloaded Mozilla suite, and found the Venkman debugger. I can't figure out how to make it debug my programs. I read a number of articles and still no luck.

First, I made the mistake of "floating" and everything disappeared. Then I found that was a bug in the program and did the fix to get the boxes back. My "interactive session" is above my "sourcecode" but it is there!

Could anyone tell me in very simple, step-by-step terms how to debug my script using Venkman? I have spent two days reading tutorials that are above me.

Thank you!

Rambo Tribble

10:30 pm on Oct 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Frankly, I find Venkman (and most debuggers) to be overkill most of the time. The fact is many professional programmers do not use debuggers, but rely on unit testing, or other techniques to find and eliminate bugs.

What I do use quite frequently is the JavaScript Console, which simply gives quick and accurate information on where the interpreter has trouble digesting code. This isn't necessarily the same thing as a bug. A bug can be valid code, but produce the wrong effect.

If you really want to wade into Venkman, you might try this article, if you haven't already: [devedge.netscape.com...]

Bernard Marx

10:57 pm on Oct 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never mastered debuggery with tools either.

Developing a sensible debugging regime, with the appropriate use of customised alerts etc, is a good strategy to start off with.

When doing anything that messes with the DOM, having a bookmarklet that shows you the browser's internal code helps. Type this into your address bar, + return:

javascript:'<xmp>'+document.documentElement.innerHTML+'</xmp>'

Then drag it over to your links bar, so you can use it as a bookmarklet.