![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Mixing variables in HTML Hi there. Does anyone know how you can get vbscript/HTA to display variables outside of the <script></script>? For example, I define a variable in the <script></script> that needs to be displayed in the body of the page. i've tried doing <%=var %> <% echo(var) %> and any number of things which no effect. Does anyone have any clue? Thanks in advance. Andy |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Mixing variables in HTML Andy wrote: Quote: > Does anyone know how you can get vbscript/HTA to display variables > outside of the <script></script>? > here are a couple: If using a text box (er sorry, the input tag), you could set the value parameter. oDoc.getElementById("myTxtBox").value = "hi there" If using a "block" tag (such as <p>), you could use the dhtml "innerText" method. oDoc.getElementById("myPar").innerText = "vbs rocks" cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Mixing variables in HTML Sorry, I should've mentioned that this is how i'm getting the data i need to print: Set diskSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("Select Size, Index From Win32_DiskDrive where Index = 0") thanks, andy "mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message news:eAE$X9PQJHA.764@xxxxxx Quote: > Andy wrote: Quote: >> Does anyone know how you can get vbscript/HTA to display variables >> outside of the <script></script>? >> > Andy, there must be a hundred ways to do this. > > here are a couple: > > If using a text box (er sorry, the input tag), you could > set the value parameter. > > oDoc.getElementById("myTxtBox").value = "hi there" > > If using a "block" tag (such as <p>), you could use the > dhtml "innerText" method. > > oDoc.getElementById("myPar").innerText = "vbs rocks" > > cheers, jw > ____________________________________________________________ > > You got questions? WE GOT ANSWERS!!! ..(but, no guarantee > the answers will be applicable to the questions) |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Mixing variables in HTML It doesn't matter where you're getting the info. for the variable. You just have to use some method of the IE DOM, as mr_unreliable demonstrated, rather than using ASP code. You can assign the value to the innerText, value, etc. of any HTML element. Quote: > Sorry, I should've mentioned that this is how i'm getting the data i need Quote: > print: > > Set diskSet = > GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("Select > Size, Index From Win32_DiskDrive where Index = 0") > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| math with "GB/MB/KB" in variables fails, without variables works? | PowerShell | |||
| working on html objects using HTML DOM, VBscript | VB Script | |||
| Mixing error? | Vista music pictures video | |||