Click to See Complete Forum and Search --> : 'repainting' a document


Muzzz
11-24-2002, 03:38 PM
Is there any way to force browsers (particularly IE) to repaint it's window/document? I'm looking for something similar to the 'repaint()' method of Java Components. I.e. I do not want the page to be reloaded.

Beach Bum
11-24-2002, 09:10 PM
can you tell us what you are trying to accomplish? the page will always be dynamically updated - for example as you change an attribute it happens - unhide an object, whatever. so in essence a page is dynamically always "repainted". so what needs "repainting"?

Beach Bum
11-24-2002, 10:12 PM
interesting

i think the page properties that are updated by js functions are also updated in real time.

for example i ran a quick test where i change picture attributes then download a picture then do other stuff. i can see the picture attributes change long before the new picture is downloaded and the last steps execute.

i think it all happens in real time - js or html attribute changes.

i suppose you could argue that what i am seeing is execution delay. but then i could argue that is the only way you could ever see a script execute.

hmmm . . .

Muzzz
11-25-2002, 09:02 AM
I'm fooling around with the following script:

<link href="style/standaard.css" type="text/css" rel="stylesheet" id="stylesheet"/>
<script type="text/javascript">
function changeStyle(newStyleURL) {
document.getElementById('stylesheet').href=newStyleURL;
}
</script>

which get's invoked like this:

<a href="#" onclick="changeStyle('style/standaard.css');">Standaard</a>

The problem is that when IE6 switches styles, not the entire page get's updated. Only the parts that contain text, etc. seem to update.

To see the 'experiment' in action, visit http://www23.brinkster.com/muzzz/StyleTest.html
Page is in Dutch, but you can simple click the links in the list (not the left-hand menu) to change styles.

Beach Bum
11-25-2002, 05:35 PM
still not sure i can see the problem. the pages seem to change when i click the linkns - text, colors, background.

remember the only thinks that will change is what is specified in the new style. if a style is not specified it will stay the same.

so exactly what do you think should change that is not changing? and show us the associated style sheet.

Beach Bum
11-25-2002, 07:31 PM
dave -

no need for me to run another test. i believe you. when someone has that detailed an approach to prove a point they are usualyy right.

cheers.

Muzzz
11-27-2002, 04:27 AM
Arggg...now all of the sudden IE seems to get my point and is cooperating like never before. Sorry for wasting your time guys...