简体   繁体   中英

avoiding page refresh when rewriting html with outerHTML

I have to read, change and rewrite an HTML OBJECT tag using node.outerHTML. on IE7.

There is a brief refresh of the screen when I do that. I guess that the browser repaints the screen when I write the HTML. The actual OBJECT tag data is the same as before with only one parameter (wmode) that has changed. Size of the object and other parameters remain the same.

Any idea how can I avoid the 'flashing' of the screen?

If you wrap the OBJECT in a container and use instead innerHTML, does that make any difference?

Alternatively, could you possibly change the value of the parameter by directly manipulating the object?

My last guess at a possible solution would be to move the object out of the visible screen (visibility: hidden, or position: absolute + left: -10000) and try performing the operation at that point.

If you're rewriting the entire tag, then it makes sense the object would be re-rendered. Is it possible simply to write the WMODE param/attribute only? In that case, you probably wouldn't get the refresh.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM