bonjour a tous
comment ajoute t-on un element dans une page html ou hta (image,text )
jai bien trouver "document.write" mais sa supprime tout ce qui etait avant
une idée??:calim2:
au plaisir
Version imprimable
bonjour a tous
comment ajoute t-on un element dans une page html ou hta (image,text )
jai bien trouver "document.write" mais sa supprime tout ce qui etait avant
une idée??:calim2:
au plaisir
:salut: voila un extrait de code qui est incomplet bien sûr mais peut-être il te donne une petite idée. dans ce code j'ai utilisé quelques emoticons de developpez.net
Code:
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 <html> <head> <HTA:APPLICATION ICON="icon.ico" APPLICATIONNAME = "SMTP Mail Client" BORDER="dialog" BORDERSTYLE="complex" CONTEXTMENU="no" SYSMENU="yes" MAXIMIZEBUTTON="no" SCROLL="no" > <style type="text/css"> input.button { background-color : #EFEFEF; color : #000000; cursor:hand; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; } input.longbt { background-color : #EFEFEF; color : #000000; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; width:100px} </style> <script language="VBScript"> Sub Save(var) Select Case var Case 0 id("SaveRes").innerhtml = "<br><span class=""gensmall"">Saving to: </span><span id=""FolderPath"">" & SaveFolder & "</span>" _ & VbCrlf & "<input type=""text"" name=""FileName"" size=""60"" >" _ & VbCrlf & "<input name=""BtnSave2"" onclick=""Save(1)"" type=""button"" value=""Save"" class=""button"">" _ & VbCrlf & "<input name=""BtnChangeFolder"" onclick=""Save(2)"" type=""button"" value=""Choose Folder"" class=""longbt"">" _ & VbCrlf & "<input name=""BtnSave2"" onclick=""Save(5)"" type=""button"" value=""Cancel"" class=""button""><br>" Case 5 id("SaveRes").innerhtml = "" Case 6 id("SaveRes").innerhtml = "<br><span class=""gensmall""></span><span id=""FolderPath"">" & SaveFolder & "</span>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/salut.gif http://www.developpez.net/forums/images/smilies(':salut:') alt=:salut:>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_biggrin.gif OnClick=emoticon(':D') alt=Very Happy>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_smile.gif OnClick=emoticon(':)') alt=Smile>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_sad.gif OnClick=emoticon(':(') alt=Sad>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/chin.gif OnClick=emoticon(':koi:') alt=what>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_eek.gif OnClick=emoticon(':shock:') alt=Shocked>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_confused.gif OnClick=emoticon(':?') alt=Confused>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/ccool.gif OnClick=emoticon('8)') alt=Cool>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_lol.gif OnClick=emoticon(':lol:') alt=Laughing>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/sm.gif OnClick=emoticon(':x') alt=Mad>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_razz.gif OnClick=emoticon(':P') alt=Razz>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_redface.gif OnClick=emoticon(':oups:') alt=Embarassed>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_cry.gif OnClick=emoticon(':cry:') alt=Crying or Very sad>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_evil.gif OnClick=emoticon(':evil:') alt=Evil or Very Mad>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_twisted.gif OnClick=emoticon(':twisted:') alt=Twisted Evil>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_wink.gif OnClick=emoticon(':wink:') alt=Wink>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_exclaim.gif OnClick=emoticon(':!:') alt=Exclamation>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/desesp.gif OnClick=emoticon(':desesp:') alt=desesp>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_idea.gif OnClick=emoticon(':idea:') alt=Idea>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_arrow.gif OnClick=emoticon(':arrow:') alt=Arrow>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_neutral.gif OnClick=emoticon(':|') alt=Neutral>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/kiss.gif OnClick=emoticon(':kiss:') alt=kiss>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/pan.gif OnClick=emoticon(':ccool:') alt=ccool>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/hola.gif OnClick=emoticon(':hola:') alt=hola>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/buttons/resolu.gif OnClick=emoticon(':resolu:') alt=resolu>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/furieux.gif OnClick=emoticon(':furieux:') alt=furieux>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/sacrain.gif OnClick=emoticon(':sacrain:') alt=sacrain>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_bug.gif OnClick=emoticon(':bug:') alt=bug>"_ & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/merci.png OnClick=emoticon(':merci:') alt=merci>"_ & VbCrlf &"<center><input name=""BtnSave2"" onclick=""Save(5)"" type=""button"" value=""Cancel"" class=""button""><br>"_ & VbCrlf &"<img src=http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif></center>" Case 7 id("SaveRes").innerhtml = "<center><h4 style='color:Red'>Type your Gmail Adress </h4>"_ & VbCrlf &"<input type=""text"" name=""GmailLogin"" id=""GmailLogin"" size=""30"" value=""GmailAccount@gmail.com"" >"_ & VbCrlf &"<h4 style='color:Red'>Type your Gmail Password </h4>"_ & VbCrlf &"<input type=""password"" name=""GmailPassword"" id=""GmailPassword"" size=""30"" ><br><br>"_ & VbCrlf &"<input name=""BtnSave2"" onclick=""SendViaGmail()"" type=""button"" value=""SEND WITH YOUR GMAIL ACCOUNT"" class=""button""><br>"_ & VbCrlf &"<br><img src=http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif></center>"_ & VbCrlf &"<input name=""BtnSave2"" onclick=""Save(5)"" type=""button"" value=""Cancel"" class=""button""><br>" End Select End Sub Function id(o) Set id = document.getElementById(o) End Function </script> </head> <body> <input name="BtnSave2" type="button" class="longbt" value="Save as..." onclick="Save(0)"><span id="SaveRes"></span> <input name="BtnSave2" type="button" class="longbt" value="Emoticons" onclick="Save(6)"><span id="SaveRes"></center></span><br> <input name="BtnSave2" type="button" class="longbt" value="Gmail" onclick="Save(7)"><span id="SaveRes"></center><br></span> </body> </html>
bonjour hackoofr
si je comprends bien ton code tu réécris les boutons ????
c'est un peu mon problème je dois avoir une centaine d'éléments sur ma page :( ça risque d'être un peu difficile
si je n'ai pas bien compris
pourrais tu me faire un exemple avec un seul ajout pour que je puisse comprendre
merci a toi
au plaisir
bonsoir hackoofr
après m'être promené sur le net
je commence a comprendre
donc utilisé le "innerhtml"
si j'ai bien compris
je met un div id="machinchose" vide dans ma page
je le récupère avec le "innerhtml" et je le modifie
est bien ça le procédé de base???
merci pour le coup de main
au plaisir