How to manipulate a DOM tree before it is displayed on screen ? ( javascript, jquery, ...) -


the problem simple, can't figure out solution. many helps. want modify web page (dom tree) before displayed on screen. understand dom tree loaded in memory before being processed.

do of knows way process loaded dom tree while on memory , let displayed new structure ?

the reason want that, because i'm working on addon adding content existing web site.

added-> need mention existing web site not mine, can't use php modify website content not mine.

but right now, web site displayed without addon content , see content coming after 1 second (because append content after website displayed), see website content moving.

thanks helping.

it's not difficult. hide body using css , on onload-event of document manipulation , show body.

short example:

<html> <head> <title>example</title> <style type="text/css"> <!-- html.scripted body{display:none;} --> </style> <script type="text/javascript"> <!-- //set class html-element, css-rule above applied body document.getelementsbytagname('html')[0].classname='scripted';  //on page load window.onload=function() {   //do manipulation   document.body.appendchild(document.createelement('em')).appendchild(document.createtextnode('dynamic content'));   alert('manipulation done');    //show body   document.body.style.display='block'; } //--> </script> </head> <body> static content </body> </html> 

in regard brad's comment below may consider if there may other ways. real issue seems moving content, possible place static placeholder dynamic content appear later.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -