Solved

Display title of Page ASAP using Document.title

Posted on 2001-07-26
4
211 Views
Last Modified: 2012-06-21
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

0
Comment
Question by:pclaypool
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
a.marsh earned 200 total points
ID: 6324953
What about using a frameset with a hidden frame?

The frameset will load and display the title and then simply load the document (that is currently loaded) in to the "visible" frame.

:o)

Ant
0
 
LVL 10

Expert Comment

by:dij8
ID: 6329604
>>> 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?
0
 
LVL 1

Author Comment

by:pclaypool
ID: 6329715
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
0
 
LVL 1

Author Comment

by:pclaypool
ID: 6336221
Frameset seems to have worked along w/ taking out the call for common.vbs (for document.title and page.innertext)

Thanx
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now