Variable HTML en javascript
beber005
-
anatolekadel Messages postés 102 Date d'inscription Statut Membre Dernière intervention -
anatolekadel Messages postés 102 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Bonjour à tous,
Je voulais savoir s'il était possible qu'une variable javascript contienne de l'html comme suit :
<code type="javascript">
var bodyCorps = '<HTML><HEAD><TITLE>NewsLetter</TITLE><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'+
'<style type="text/css">'+
'*{padding: 0px;margin:0px;}hr{ visibility: hidden;}.image{ background: transparent url(\'cid:ENTETE.gif\') no-repeat top center;height:200px;padding-right:8px;padding-top: 90px;}'+
'.bordureDuHaut{background: transparent url(\'cid:BORDURE_haut.gif\') no-repeat top;height:6px;}.fond{background: transparent url(\'cid:FOND_1px.gif\') top;height:569px;font-family:calibri,cambria,arial,candara;color :#000099;}'+
'p{text-align: center;}#texte{padding-left:20px;font-size:130%;}#texteScrollable{position: relative ;width:800 ;height:569;overflow :auto ;font-size: 10pt;}'+
'.bordureDuBas{background: transparent url(\'cid:BORDURE_bas.gif\') no-repeat top;height:6px;}.finDuFond{background: transparent url(\'cid:FOND_1px.gif\') top;height:6px;}'+
'#bouton_send{text-align: center;width:100%;}.logoAirbus{float:right;width:100px;background:white url(\'cid:LOGO_AIRBUS.gif\') no-repeat;height: 24px;}'+
'</style></HEAD><BODY><div class="image"><div align="bottom" class="logoAirbus" ></div></div><div class="fond" id="texteScrollable"><div class="bordureDuHaut">'+
'</div> <div id="texte"><p><b>Dear all,</b></p>'
'</div></div><form method=post action="test.php"><div class="finDuFond"><div class="bordureDuBas"></div></div></form></BODY></HTML>'
</code>
Et si oui s'il était possible que l'HTML soir interprété par la suite merci bcp
Bonjour à tous,
Je voulais savoir s'il était possible qu'une variable javascript contienne de l'html comme suit :
<code type="javascript">
var bodyCorps = '<HTML><HEAD><TITLE>NewsLetter</TITLE><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'+
'<style type="text/css">'+
'*{padding: 0px;margin:0px;}hr{ visibility: hidden;}.image{ background: transparent url(\'cid:ENTETE.gif\') no-repeat top center;height:200px;padding-right:8px;padding-top: 90px;}'+
'.bordureDuHaut{background: transparent url(\'cid:BORDURE_haut.gif\') no-repeat top;height:6px;}.fond{background: transparent url(\'cid:FOND_1px.gif\') top;height:569px;font-family:calibri,cambria,arial,candara;color :#000099;}'+
'p{text-align: center;}#texte{padding-left:20px;font-size:130%;}#texteScrollable{position: relative ;width:800 ;height:569;overflow :auto ;font-size: 10pt;}'+
'.bordureDuBas{background: transparent url(\'cid:BORDURE_bas.gif\') no-repeat top;height:6px;}.finDuFond{background: transparent url(\'cid:FOND_1px.gif\') top;height:6px;}'+
'#bouton_send{text-align: center;width:100%;}.logoAirbus{float:right;width:100px;background:white url(\'cid:LOGO_AIRBUS.gif\') no-repeat;height: 24px;}'+
'</style></HEAD><BODY><div class="image"><div align="bottom" class="logoAirbus" ></div></div><div class="fond" id="texteScrollable"><div class="bordureDuHaut">'+
'</div> <div id="texte"><p><b>Dear all,</b></p>'
'</div></div><form method=post action="test.php"><div class="finDuFond"><div class="bordureDuBas"></div></div></form></BODY></HTML>'
</code>
Et si oui s'il était possible que l'HTML soir interprété par la suite merci bcp
A voir également:
- Variable HTML en javascript
- Editeur html - Télécharger - HTML
- Telecharger javascript - Télécharger - Langages
- Br html ✓ - Forum Webmastering
- Espace en html ✓ - Forum HTML
- [**] Balise pour un espace vide en hml. Merci ✓ - Forum Webmastering
1 réponse
Je ne suis pas expert en JavaScript. Mais je crois que tu peux "remplir une variable (de type chaîne de caractère) avec du code (du HTML par exemple). Ensuite, si tu veux que celui-ci soit interprété comme du HTML, il suffit de l'afficher (document.writeline).
Mais je ne suis pas certain.
En PHP, c'est faisable avec un echo; alors je ne vois pas pourquoi en JS, ce ne serait pas faisable...
Mais je ne suis pas certain.
En PHP, c'est faisable avec un echo; alors je ne vois pas pourquoi en JS, ce ne serait pas faisable...