Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Small javascript issue with resize of browser window  (Read 5315 times)

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Small javascript issue with resize of browser window
« on: February 26, 2008, 06:45:59 am »

Code: [Select]
<body onResize="window.location.href = window.location.href;">
I have a page being written where IE7 requires a reload following a window resize and found this snippet on the web for doing that, BUT, HTML Tidy is whining about the beast...
any way to avoid the warning on that?

Also, why does IE7 through up an ActiveX complaint on this small snippet? Any way to avoid that???
Logged
Yes! I have no siggy.

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: Small javascript issue with resize of browser window
« Reply #1 on: February 26, 2008, 04:06:14 pm »

Some live example? (i'm too lazzy to test on a "home made" test page ;) )
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: Small javascript issue with resize of browser window
« Reply #2 on: February 26, 2008, 09:29:33 pm »

Logged
Yes! I have no siggy.

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: Small javascript issue with resize of browser window
« Reply #3 on: February 27, 2008, 11:13:52 am »

First of all, there is no "resize" attribute for the <body> tag.
So, instead of inserting the resize there, maybe you should insert the code below in the <header> section:
Code: [Select]
<script type="text/javascript">
window.onresize = doResize;
</script>
Apart from that, you have several other small validation errors. Like the <pre> tag inserted into a <p>. It's not correct! Read more details here. Same with <address> tag.
Also, you have added a semicolon ";"  in a <dt> tag on line 330: instead of
Code: [Select]
<dt class="highlight"; >Definition Term</dt>it should be
Code: [Select]
<dt class="highlight">Definition Term</dt>
Other than that, I don't know about the activex issue on IE7.
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: Small javascript issue with resize of browser window
« Reply #4 on: February 27, 2008, 05:41:59 pm »

thanks.
and I have caught those items on my local copy. thanks again.
Logged
Yes! I have no siggy.

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: Small javascript issue with resize of browser window
« Reply #5 on: February 27, 2008, 07:18:24 pm »

You're welcome! :)
Logged