Link to home
Start Free TrialLog in
Avatar of pclaypool
pclaypool

asked on

Display title of Page ASAP using Document.title

Greetings All;
I am opening a new window using DEWindow.Open

The next window, onload, should display a Document.Title and some page.innertext as soon as possible.

The problem is, I have more script in the page that also needs to run.  What happens is, the window opens fine (without a toolbar and such), but the document.title still has the refering page rather than the value I have called from a common.vbs file and the page.innertext are not displayed until after the page has completely executed it's script.  

Restrictions:
I must use VBSCript to generate the document.title and page.innertext from common.vbs (which I can do, msgboxes confirm i am retrieving the values at the right time).

I cannot program this in the previous (Calling) page.

Possible Solutions tried and failed:
Placing this in a seperate vbscript block at the beggining of the page
Using window_unload function to call this function, then the rest of the script as another function

Any help anyone could provide would be greatly appreciated.

Thanks

ASKER CERTIFIED SOLUTION
Avatar of a.marsh
a.marsh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>> Placing this in a seperate vbscript block at the beggining of the page

Is that before or after the <body> tag?  Have you tried both?  Immediately after the <body> tag will be the first thing the page generates (sort of).  Code is run in the order of serverside includes, serverside script, clientside script, HTML.  Can you not just have the function called immediately after it is written:
<script language="VBScript">
sub yoursub
  the stuff you do
end sub
yoursub
sub othersubs
  other subs that can be dealt with later.
end othersubs
</script>

>>> msgboxes confirm i am retrieving the values at the right time

Can you not replace the msgbox with just calling the necessary function?
Avatar of pclaypool
pclaypool

ASKER

for a.marsh,
Thanks for the comment.  I tried this (using framesets) and the same behavoir happened.  This causes me to think that either the call to common.vbs for the page.innertext and the docuent.title is very slow or there is a problem with the layout of my HTML.  I had to change it back, since this is starting to become a Production system.  

I will try dij8's comments to determine how this works.

here's some of the code:

server side script
<HTML>
   <HEAD>
      <TITLE></TITLE>
   </HEAD>
   <BODY>
      <P id="pageText"></P>
   </BODY>
<script language=VBscript>
load the xml
 'Write out the Page Title and Page text of the HTML w/ Lang Support
   document.title = nodeListReportParam.item(0).childnodes.item(6).text
   pageText.innertext = nodeListReportParam.item(0).childnodes.item(7).text
</Script>

<Script language=VBSCript>
another client side script block
</script>

THe way this works now, a user would need to wait for the entire xml to be returned before the page.innertext and document.title would be displayed.  

I have tried calling page.innertext and document.title from common.vbs, which has a function that calls the database and populates an xml string based on the screen ID we have defined.  What this essentialy does is take the two childnodes for page.innertext and document.title out of a "possibly" huge xml string and gives me another xml document that has exactly what I need, right away.  Problem is, even though I have it, the information isn't being displayed untill the second client side script block is finished running.

Thanks again for all your help
Frameset seems to have worked along w/ taking out the call for common.vbs (for document.title and page.innertext)

Thanx