Jump to content
vmars316

input type="button" onclick="window.reload(); ?

Recommended Posts

Hello & Thanks ,

I would like to know why this doesn't work:

<input type="button" onclick="window.reload(); return false;" value="click me" />

but this does:


Thanks

Share this post


Link to post
Share on other sites

Something seems to be missing here.

 

I don't see a reason why your first line of code would not work. What happens when you try it?

Share this post


Link to post
Share on other sites

Hmm...

Yes , that's interesting .

this one:

<input type="button" onclick="window.reload(); return false;" value="click me" /> </a>
runs fine , locally , no errors .
This one run locally , gives this error:
<input type="button" onclick="window.reload(); return false;" value="click me" />
mozilla.org-Breakout-All-ReadOnly-vmTest01.html:18 Uncaught TypeError: window.reload is not a function
Run online:
they both get errors:

<input type="button" onclick="window.reload(); return false;" value="click me" /> </a>

mozilla.org-Breakout-All-ReadOnly-vmTest01.html:16 Uncaught TypeError: window.reload is not a functiononclick @ mozilla.org-Breakout-All-ReadOnly-vmTest01.html:16
<input type="button" onclick="window.reload(); return false;" value="click me" />
mozilla.org-Breakout-All-ReadOnly-vmTest01.html:18 Uncaught TypeError: window.reload is not a function

The surrounding code looks like this:

 

<body>

<canvas id="myCanvas" width="480" height="320"></canvas>
<div <div style="background-color:#eeeeee; width:480px; margin:0 auto;">
<img id="flaming" src="./sprites/fireTransparent.gif" width="480" height="42" />
<input type="button" onclick="window.reload(); return false;" value="click me" />
</a>
<input type="button" onclick="window.reload(); return false;" value="click me" />
</div>
<script>

 

 

I can Post the whole code if you like , its 196 lines .
You can run it here:
It's the breakout game , with a few additions .

 

Thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...