Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9075555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:53:06+00:00 2026-06-16T18:53:06+00:00

in my html: <body onresize=doSomething();> I have this in my javascript: function doSomething() {

  • 0

in my html:

<body onresize="doSomething();">

I have this in my javascript:

function doSomething() {
    alert(1);
    // it doesn't actually have alert(1), but this is just for demonstration
}

When i resize the browser window ( by double clicking its title ), the event fires twice in IE8, thus messing up with the function.

Does anyone know why and how it can be avoided ?
thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:53:08+00:00Added an answer on June 16, 2026 at 6:53 pm

    You will find, that if you “resize around” a browser window by randomly moving around the drag area in the lower right corner, the onresize event fires repeatedly.

    The point is, that it is quite debateable, what constitutes a window resize. You will have to accept, that this is wildly different between browsers and OSes.

    Recipies to handle that include cancelling if set, then setting a timer (window.setTimeout) on the resize event and doing the real resize work when the timer fires.

    If your onresize is not too expensive, you should just create it in a way, that is unconcerned by repeated calling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://subzerostudio.com/temp/verticalscroller/temp.html I want this scroll to effect the div#container instead of the body,html but
So i got this snippet of code: $(document).ready(function () { var replacementDoneIn = $(body).html();
I have html body and I use this code to select particular piece of
I have a layout.jade that looks like this: html body block content block footer
I have mouse actions triggering a custom function on the html and body, however
This works in all my test browsers: <body onresize=handleResize()>   // Aint perfect, but
so in my html i have this portion: <body ondblclick=myfunc();> <div id=id1>dasd</div> <div id=id2>dasda</div>
The recursive setTimeout function getRandomProducts is called onload in the html body tag, and
I made this Greasemonkey script: var maxpi = 250; var p1 = /html/body/div/div[2]/div/div[2]/table[2]/tbody/tr[1]/td[11]; var
$(this).parent().parent() .children(this.attr(tagName).toLowerCase()) .css(background-color, yellow); xpath: /html/body/div/table/tr/td/b/a $(this).tagName is Anchor <a> the problem with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.