Bonjour,
j'aimerais afficher variable ou appel une function dans la balise html
ONSCR.InnerHTML="<TABLE HEIGHT=......
Par Exemple je voulais affichier username a partir d'une Function GetUserName().
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 'Fenetre Windows SUB InnerWindowSize(intWidth,intHeight) Self.ResizeTo intWidth,intHeight Self.ResizeTo intWidth+(intWidth-Document.Body.OffsetWidth),intHeight+(intHeight-Document.Body.OffsetHeight) Self.MoveTo (Screen.Width/2)-(intWidth/2),(Screen.Height/2)-(intHeight/2) END SUB 'Position Windows Sub CenterWindow(x,y) window.resizeTo x, y iLeft = window.screen.availWidth/2 - x/2 itop = window.screen.availHeight/2 - y/2 window.moveTo ileft, itop End Sub 'Infomation pc SUB Nettoi() Self.document.title = "information pc" CALL InnerWindowSize(500,700) ONSCR.InnerHTML="<TABLE HEIGHT=""50"" WIDTH=""220"" BORDER=""1"" BGCOLOR=""#BBBFFF"" BORDERCOLOR=""#000000"" CELLPADDING=""0"" CELLSPACING=""1"">"_ &"<TR BGCOLOR=""#346E99""><TD COLSPAN=""2""><CENTER><FONT COLOR=""#FFFFFF"" SIZE=""+2"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">information pc</FONT></CENTER></TD></TR></TABLE>"_ &"<TABLE WIDTH=""700"" HEIGHT=""500"" BORDER=""1"" BGCOLOR=""#BBBFFF"" BORDERCOLOR=""#000000"" CELLPADDING=""0"" CELLSPACING=""1"">"_ &"<tr><td>L'information pc : value=""&GetUserName&""</td>"_ &"<TABLE HEIGHT=""50"" WIDTH=""500"" BORDER=""1"" BGCOLOR=""#BBBFFF"" BORDERCOLOR=""#000000"" CELLPADDING=""0"" CELLSPACING=""1"">"_ &"<TR BGCOLOR=""#346E99""><TD COLSPAN=""2""><CENTER><INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Fermer"" ONCLICK=""window.close()""></CENTER></TD></TR></TABLE>" END SUB Function GetUserName() Dim objNetwork Set objNetwork = CreateObject("WScript.Network") GetUserName = objNetwork.UserName End Function Call Nettoi()
J'ai mis <tr><td>L'information pc : value=""&GetUserName&""</td>
mais ça ne marche pas.
Merci
Partager