Prev: msgbox title issue
Next: Script for deploying SP3
From: MarceepooNu on 12 Aug 2010 01:07 After I do some editing to Hta files, I clcik a button which calls a vbscript that runs the following code: Location.Reload(True) I would like to return to the location where the button appears on the hta page, but I can't figure out how to do that. I've found some techniques (which I've forgotten, and) which somehow enabled me to get to a spot somewhere on the hta page, but that spot was a few lines too low. Then, I spent I'm embarassed to even think of how many hours I wasted fruitlessly trying to figure out how to scroll a few lines up the page. And then gave up. I thought, Gee wouldn't it be great if I could somehow store the origin's location somewhere, and have the OnLoad program look for that info. Short of creating a new hidden window in which the location would be stored, I haven't been able to figure out how to get back to the origin location. Any input about this stuff would be much appreciated. Thanks again, MarceepooNu -- MarceepooNu
From: Mayayana on 12 Aug 2010 09:29 PagePos = Document.Body.scrollTop Document.Body.scrollTop = PagePos That can scroll the page to where it was before reloading. I guess there'd be a few ways to store the value. Nothing comes to mind offhand other than writing it to disk. It'd be nice if the value could be stored by the parent window object, but I don't know any way to do that. Note that if you want to use a standards-compliant DOCTYPE you might have to use document.documentelement rather than body. I have yet to find a definitive reference that details exactly which body methods/properties are now valid and which have been moved to documentelement. Since IE6, with quirks mode, there are basically two DOMs. You decide which to use by whether or not you declare the page code as standards compliant. It would be tempting to just go with standards and leave out any IE5 people, but unfortunately, the standards compliance of IE varies from IE6 to IE7 to IE8. So you're faced with either keeping up with progress and writing to 3 versions of IE at once, or skipping compliance in favor of quirks mode, so that you can write the same page for all versions of IE and get basically IE5 display. (I think Microsoft calls it "IE5/6 display", but they're not being honest there. IE5 and IE6 do *not* display exactly the same way.) There's also a scrollintoview method that you can use on the button. If that's good enough then you won't need to store a value. | After I do some editing to Hta files, I clcik a button which calls a vbscript | that runs the following code: | Location.Reload(True) | | I would like to return to the location where the button appears on the hta | page, but I can't figure out how to do that. | | I've found some techniques (which I've forgotten, and) which somehow enabled | me to get to a spot somewhere on the hta page, but that spot was a few lines | too low. | Then, I spent I'm embarassed to even think of how many hours I wasted | fruitlessly trying to figure out how to scroll a few lines up the page. And | then gave up. | | I thought, Gee wouldn't it be great if I could somehow store the origin's | location somewhere, and have the OnLoad program look for that info. Short of | creating a new hidden window in which the location would be stored, I haven't | been able to figure out how to get back to the origin location. | | Any input about this stuff would be much appreciated. | | Thanks again, | | MarceepooNu | -- | MarceepooNu
|
Pages: 1 Prev: msgbox title issue Next: Script for deploying SP3 |