Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Mon, 5 Mar 2007 16:15:26 -0800,    group: microsoft.public.inetsdk.programming.scripting.jscript        back       


window.parent.navigate() does not position new page correctly sometimes   
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
date: Mon, 5 Mar 2007 16:15:26 -0800   author:   David Ching

Re: window.parent.navigate() does not position new page correctly sometimes   
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/
date: Mon, 05 Mar 2007 19:38:48 -0500   author:   Randy Webb

Re: window.parent.navigate() does not position new page correctly sometimes   
"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
date: Thu, 8 Mar 2007 12:34:29 -0800   author:   David Ching

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us