I am a very new in web programming. I have a problem with this page. When I put a question like '10 cm in inches', or ' 3 pounds in kilograms', it gives me multiple answers!
How do I align the three tables? I tried thousands of different ways, but I still don't know how to do it. Is it possible to put the answer on the same page as the question form is? How do I do that?
Here is the source as attachment. Can you have a look at the page?
You must have a semicolon at the end of each statement in JavaScript.
Code:
<!-------------------------------------------
You can't have a --sequence within a comment (<!-- -->)
____
Ok, to display the answer on the same page, you can put a div element like this:
<div id="answer"></div>
and then in JavaScript you can say
Code:
window.document.all['answer'].innerHTML = "your HTML tags".
this should actually work with any html tag that can have other tags inside it.
____
You could let the users select your units from a list of items, using <select>, but that is too easy and the way you let them ask a question is pretty professional, artificial intelligence, cool.
Your script is pretty long and some sections seem to repeat. You could optimise it, etc.
____
Aligning tables:
I would use one big table with the other tables within them.
____
It is general knowledge that I can't explain things. So if I failed to make something clear, post and I'll try harder.
Not all browsers are good. Some of them go bad.
Not long ago, one of them went as bad as you can go. His hame was I.. I... Well, people usually say that he is a browser That Must Not Be Named.
That browser killed many of our best coding conventions. It twists features. It knows how to counter-bug any of our designs. It is in possesion of a group of supporters so large that no other browser may stand up to it and live.
But now there is a hope.
I don't understand when u say that i did several mistakes in the code. Can you explain pleae? Or tell me what shall I put instead?
code:--------------------------------------------------------------------------------...var inch = -5
var cm = -5
var mile = -5
...--------------------------------------------------------------------------------
Originally posted by King Pellinore You must have a semicolon at the end of each statement in JavaScript.
Not always. If you have more than one statement on a line, a semi-colon is required to separate the statements. However, an end-of-line character will end a javascript statement just as syntactically correct as ending it with a semi-colon.
It helps readability and debugging if you always use them.
Bookmarks