$Bill
6/18/2016 2:00:00 AM
On 6/17/2016 02:32, Evertjan. wrote:
> $Bill <news@todbe.com> wrote on 17 Jun 2016 in comp.lang.javascript:
>
> window.onload = init;
>
> then you can set the <script> inside the <head>, where it belongs.
>> document.body.onload = null; // trying to prevent 2nd load
> This is nonsense, a document always loads once, and then is a new document.
What do you expect on my first try at using Javascript? ;)
> The form is executed, so the page reloads and the javascript execution is
> lost, so do a "return false" to prevent the form from executing:
>
> <button onclick='flipType();return false;'>Flip View</button>
>
> or set the <button> outside a <form>
I knew there had to be a way to do that - just hadn't found it yet.
Didn't realize that the form execution was causing the re-load.
> I prefer lowercase html, less screaming.
I just normally UC the HTML tags.
> And leave out the copious commenting on usenet,
> as the lines get too long.
That was for the benefit of the post to explain what I thought I
was doing/trying to do.
> Try this:
Much grass amigo. That works like a charm. Now I need to slip all
the actual HTML into those two vars ...