quick question, I am a newbie, first with this site, and with programming. this is my first semester and I am learning the basics. I am having a problem with Javascript. this simple code is supposed to just create a web page with the tile , my name and then I am supposed to add text to the page (using astericks), according to the visitor input information. I have the code working to the point of asking which object (right trangle, left triangle, isoceles triangle or rectangle), I have it then alerting the question about the height of the object, (the while loop i have in there set to give an invalis response it working well, the problem I have it getting the actual text on the page in the shape of the object as astericks, anytime I use the document.write(), i get a number (from the user) that screams across the page and gives me a scriptting error. This is probably something simple, dont laugh too hard. O have tried several different ways and used the w3schools website for more info and cant seem to get this to work. any suggestions, maybe another website with more examples.

thanks ahead of time for the help


9 Years
Discussion Span
Last Post by MidiMagic

JavaScript != Java

This is the Java forum, not the JavaScript forum. The designers did not just simply forget to include "Script" in the name, they are really two different things.

Next time post into the JavaScript forum. I have already asked the moderators to move this thread.


Let's see the relevant part of the code.

I have a few thoughts:

- Could the problem be an "unable to render as instructed" case? If your designed shape doesn't fit in the available space, the browser will alter the rendering.

- Could it be a 'condensing whitespace" case? The browser will throw away all whitespace except one blank character, unless you specifically tell it not to.

- Could it be a problem with a variable-width font? Spaces are not the same width as asterisks in most fonts.

- Is the browser substituting fonts? Remember that each user can pick his own default rendering font. Also remember that your chosen font might not exist on the user's computer.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.