Forum Moderators: open

Message Too Old, No Replies

Refresh on browser resize?

         

JAB Creations

10:33 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a way to detect when a browser is being resized? If so how can I force the page to refresh when they do this?

Here is my rough idea IoI...

<SCRIPT TYPE="text/javascript">
<!--
onResize='location.reload()'
// -->
</SCRIPT>

JAB Creations

10:49 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Figured it out! :-)
<body onResize="window.location=window.location;">

Bernard Marx

12:44 pm on Nov 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



..or:

window.location.reload( false );

JAB Creations

1:00 pm on Nov 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



false= not going to refresh I'm assuming... as it is not with that code in FF.

Bernard Marx

1:11 pm on Nov 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you put
true
, then the browser is supposed to do a complete refresh - A new server request. I assume you don't want that.

If you put in no argument, then the browser will reload the content from the cache, unless the browser is set to always refresh from source. This is more the behaviour you need.

To be honest, I'm not sure whether putting in an explicit false as an argument has any different effect from having no argument. I'm hoping that it will make the browser always refresh from cache, whatever it's default setting, but it's only a hope. There's certainly no harm in trying.

Can't think why it's not working in FF. 'false' can't mean 'don't reload', else that'll be a command saying:

reloadTheContent('ignoreThisCommand')

..which would be a little pointless.

JAB Creations

1:38 pm on Nov 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok well I pasted it as false so of course it would not refresh! :-D

Interesting so my final working idea refreshes the cache and yours refreshes from the server?

This is only being implemented if the user resizes their window as objects are dynamically rendered in width and height based upon the browser's dimensions so as far as this specific script goes I just need it to refresh to any extent.

However I must say it is VERY good to know that there are two very seperate and clear ways of refreshing the browser!