Results 1 to 3 of 3

Thread: (RESOLVED, Finally) An IE status window

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Posts
    30

    (RESOLVED, Finally) An IE status window

    I'm trying to create a web page that will open a new controlled window that will display some text for the current operation. Then, I would like it to update when a new operation starts, and then completes.

    I was thinking about using a DIV element to do this, and then use the insertAdjacentHTML method with VBScript.

    Is this a good idea, or is there a better way?

    Thanks,
    Chris


    {EDIT}

    Well, I was pre-mature in me adding RESOLVED to the title. Here's the code I'm trying to work with so far:

    Code:
    <HTML>
    <HEAD>
    <TITLE>Document Title</TITLE>
    <Script Language="VBscript">
    Sub Window_Onload
    
    	'* create dialog window
    	Set objDialogWindow = window.Open("about:blank","ProgressWindow","height=15,width=250,left=300,top=300,status=no,titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=no") 
    	objDialogWindow.Focus()
    	objDialogWindow.ResizeTo 250,15
    	objDialogWindow.document.body.style.fontFamily = "Helvetica"
    	objDialogWindow.document.body.style.fontSize = "11pt"
    	objDialogWindow.document.writeln "<head>"
    	objDialogWindow.document.writeln "   <title>Progress Window</title>"
    	objDialogWindow.document.writeln "</head>"
    	objDialogWindow.document.writeln "<html>"
    	objDialogWindow.document.writeln "   <body>"
    	objDialogWindow.document.writeln "         Scanning <div id=ServerName></div>"
    	objDialogWindow.document.writeln "         <div id=InsertText></DIV>"
    	objDialogWindow.document.writeln "   </body>"
    	objDialogWindow.document.writeln "</html>"
    	objDialogWindow.document.body.style.borderStyle = "none"
    	objDialogWindow.document.body.style.marginTop = 15
    	For x = 1 To 1000
       		If X = 1 then
       			ChangeServerName "<B>SERVERNAME</B>", objDialogWindow
       		Elseif x Mod 10 = 0 Then
       			AddPeriod
       		End If
       	Next
    
    End Sub
    
    Sub ChangeServerName(strText, objDialogWindow)
    	objDialogWindow.document.all.namedItem(ServerName).innerHTML=strText
    End Sub
    
    Sub AddPeriod
    	objDialogWindow.document.all.namedItem(InsertText).insertAdjacentHTML "beforeEnd", "."
    End Sub
    </script>
    </HEAD>
    <BODY>
    EXECUTING SCRIPT...
    </BODY>
    </HTML>

    As you could probably tell, I'm trying to manipulate a child window, by removing/adding text into certain id tags.

    Could someone help me on this? Can anyone please tell me what I'm doing wrong here?

    Thanks,

    Chris
    Last edited by Shadow07; Oct 5th, 2003 at 07:13 PM.
    Chris Lynch

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Posts
    30

    (RESOLVED)

    Sheesh. Maybe I just need to drink some more coffee. I got it working, and if anyone wants to know how I did get it to work, here's the code:

    Code:
    <HTML>
    <HEAD>
    <TITLE>Document Title</TITLE>
    <Script Language="VBscript">
    Sub Window_Onload
    
    	Dim ServerName
    	
    	ServerName = Array("REALLYLONGSERVERNAME","SHORTNAME")
    	
    	'* create dialog window
    	Set objDialogWindow = window.Open("about:blank","ProgressWindow","height=100,width=450,left=300,top=300,status=no,titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=no") 
    	objDialogWindow.Focus()
    	objDialogWindow.document.body.style.fontFamily = "Helvetica"
    	objDialogWindow.document.body.style.fontSize = "11pt"
    	objDialogWindow.document.writeln "<head>"
    	objDialogWindow.document.writeln "   <title>Progress Window</title>"
    	objDialogWindow.document.writeln "</head>"
    	objDialogWindow.document.writeln "<html>"
    	objDialogWindow.document.writeln "   <body>"
    	objDialogWindow.document.writeln "         Scanning <div id=ServerName></div><div id=InsertText></DIV>"
    	objDialogWindow.document.writeln "   </body>"
    	objDialogWindow.document.writeln "</html>"
    	objDialogWindow.document.body.style.borderStyle = "none"
    	objDialogWindow.document.body.style.marginTop = 15
    	For y = LBound(ServerName) To UBound(ServerName)
    		For x = 1 To 1000000
    	   		If X = 1 then
       				ChangeServerName "<B><font size=1>" & ServerName(y) & "</font></B>", objDialogWindow
       				ClearPeriod(objDialogWindow)
       			Elseif x Mod 25000 = 0 Then
    	   			AddPeriod(objDialogWindow)
       			End If
       		Next
       	Next
    
    End Sub
    
    Sub ChangeServerName(strText, objDialogWindow)
    	objDialogWindow.document.all.namedItem("ServerName").innerHTML=strText
    End Sub
    
    Sub AddPeriod (objDialogWindow)
    	objDialogWindow.document.all.namedItem("InsertText").insertAdjacentHTML "afterBegin", "."
    End Sub
    Sub ClearPeriod(objDialogWindow)
    	objDialogWindow.document.all.namedItem("InsertText").innerText = ""
    End Sub
    </script>
    </HEAD>
    <BODY>
    EXECUTING SCRIPT...
    </BODY>
    </HTML>
    It works quite well for me, however I cannot seem to get the text to be all on one line. But, that's not a show stopper.
    Chris Lynch

  3. #3
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    that is pretty good especially when you have tags backwards.
    Code:
    objDialogWindow.document.body.style.fontSize = "11pt"
    	objDialogWindow.document.writeln "<head>"
    	objDialogWindow.document.writeln "   <title>Progress Window</title>"
    	objDialogWindow.document.writeln "</head>"
    	objDialogWindow.document.writeln "<html>"
    	objDialogWindow.document.writeln "   <body>"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width