trigger onresize in cross browser compatible manner
问题 I would like to trigger the onresize event from my C# code behind. I think this can be done with Page.clientScript.RegisterScriptBlock(this.getType(), "id", "javascript code"); I have tried element.onresize() but it doesnt seem to work in firefox. What is the correct way to trigger an onresize event similar to the following jQuery? $("body").trigger("resize"); Using jQuery itself isn't an option. 回答1: This should do the trick, DOM Level 2, no idea whether this works in IE6, quirks mode still