Hello, I am writing a Vista gadget, which I believe is loosely based on IE. In the OnLoad() event of the HTML page, if I execute window.parent.navigate("AnotherPage.html") then AnotherPage.html is shown, except the Vista SideBar doesn't always position the new page correctly. Sometimes it's offset by about 100 pixels horizontally and 20 pixels vertically. I thought navigate() simply replaces the content of the current window, but it seems like it's only replacing part of that content? But the positioning sometimes is corrrect, and sometimes not; it's not consistent! This is probably a bug in the Vista Sidebar host container. Can someone verify whether window.parent.navigate() is the correct way to replace the contents of the entire window with another HTML page? Thanks, David
David Ching said the following on 3/5/2007 7:15 PM: > Hello, I am writing a Vista gadget, which I believe is loosely based on > IE. In the OnLoad() event of the HTML page, if I execute > > window.parent.navigate("AnotherPage.html") > > then AnotherPage.html is shown, except the Vista SideBar doesn't always > position the new page correctly. Sometimes it's offset by about 100 > pixels horizontally and 20 pixels vertically. I thought navigate() > simply replaces the content of the current window, but it seems like > it's only replacing part of that content? But the positioning sometimes > is corrrect, and sometimes not; it's not consistent! This is probably a > bug in the Vista Sidebar host container. > > Can someone verify whether window.parent.navigate() is the correct way > to replace the contents of the entire window with another HTML page? window.location.replace() -- Randy Chance Favors The Prepared Mind comp.lang.javascript FAQ - http://jibbering.com/faq/index.html Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
"Randy Webb" wrote in message news:7uqdnZaxMPO6JXHY4p2dnA@telcove.net... > window.location.replace() > Thanks Randy, that seems much more logical. It did not solve the offset problem, however. The offset problem was solved by invoking the code to reload the page only after a half second timeout. I don't like these timeouts, but it did fix the problem, although who knows why. -- David