Fun Stuff > CLIKC

Need help (lots) with Javascript

<< < (4/13) > >>

pwhodges:
IMPLICIT wasn't in the language when I was using it...  When there's no alternative, the defaults are easy enough to read so long as they are stuck to.

cesium133:
Yes, but there are still Fortran programs I've come across that don't use it.

ev4n:

--- Quote from: snalin on 20 Aug 2013, 00:56 ---
--- Code: ---for(var i = cars.length-1; i >= 0; i--) {

}

--- End code ---

--- End quote ---

I do'nt know enough about Java to say for sure, but your code made me wince.

(click to show/hide)While I would imagine i is signed, your code fails spectacularly if it's unsigned.  Maybe that's more of a C concern, though.

Of course, you probably knew that.

Sorflakne:
Ok, that makes sense on i...pretty much no indication was given as to why i seems so important in the material I'm using (I've switched over to W3Schools completely, they've made the most sense so far). 

Now I'm running into another problem, and I cannot figure out why this is happening.  A little backstory: I'm creating what amounts to a "test" or "basic reference" page of some of the stuff I've learned so far (most everything else I've written in a notebook).  It's pretty much all simple stuff like "Push this button for a message popup" and different ways of making it do that, and a couple random stuffs tied to what time of day it is.  In other words, a beginners reference pool of examples with short explanations following each block of code.

The problem now, is that whenever I try adding a block of text to the page that describes something that, ironically, is about error messages, the page just displays "Error" whenever I load it up.  However, if I delete a particular line from this paragraph, the page loads as normal.  The paragraph where this is happening is enclosed by simple <p></p>, and has no scripts or other HTML in it and is otherwise not tied to any other block of code on the page at all (well, maybe not entirely, see below).  Even putting the line in its own paragraph does not solve the problem, and it's a line that I kind of need in the description for it to make sense; it's a sentence about not defining the script as "text/javascript" in the <script> tag, but even when I break it up and make it as uncode-like as possible, it still returns "Error".  It seems that if the word "script" appears in the sentence, the page fails (I had to spell it as s-cript for it to not break the page), and even having parenthesis in the paragraph block does it too.  I've no idea how or why this is causing problems.

Edit: It seems I can't add anything to the page now without causing the "Error" to display, regardless of where I add stuff on the page...

-

Another problem I've noticed is that after doing a document.write example of displaying the heading sizes from 1 to 6 in descending order, all the text below this is now in heading 6 format.  None of the subsequent stuff is tied to it, but I can't break it away from the heading 6 size.  Not sure how to begin fixing this one...

pwhodges:
Have you closed your <h6> with a </h6>?

In programming, or HTML, or just about anything to do with computers, understanding the strictness of the requirement to bracket things and match bracketed structures in the right places is crucial.  When you are writing code to output HTML it gets more complex because the bracketed structures in the HTML are not nested in the same universe (as it were) as the bracketed structures in the code... The fact that in some circumstances you can get away without closing brackets just complicates things - think in terms of always closing structures properly even if you think you don't have to and (a) life will actually get simpler and (b) your HTML will have a better chance of validating in the end.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version