Page refresh leading to larger font size when using popups


Well this was one error i faced during on of my development projects. I have a button click firing a ShowModalDialog window. On close of that window, i want the parent to refresh. But the problem was that, when i close the dialog box or popup, the parent page finishes its loading and shows up with a larger font size.

I first thought it was because of the use of  ’em’ for font sizes, in my stylesheet. Did a lot of research and finally got to the bottom of it.

The simplest solution is by using window.location.href=window.location.href for the parent.

This will just refresh the parent page. In case you want to reload the parent, you can use:

window.location.reload(true);

Hope this helps!

Feel free to leave a reply here...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: