Forum-webmaster
Technique - programmation => Javascript / DOM / Ajax => Message commencé par: KanoKa le le 05-01-2010 a 08:45:59

Titre: script java dans une newsletter
Posté par: KanoKa le le 05-01-2010 a 08:45:59

Bonjour à tous,
peut-on mettre un script dans une newsletter?
Quand je regarde la page dans le navigateur, tout est nickel. Dès que je l'envoie par courrier, le script ne marche pas. Il s'agit d'une petite neige qui tombe...
Si vous pouviez m'aider?
Voici le code source, peut-être aurez-vous une idée,

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Serif WebPlus 11.0.6.030">
<title>Accueil</title>
<style type="text/css">
<!--
body {margin: 0px; padding: 0px;}
a:link {color: #2c3651;}
a:visited {color: #1f5b8b;}
a:hover {color: #2c3651;}
a:active {color: #2c3651;}
.Normal-P
{
margin:0.0px 0.0px 0.0px 0.0px; text-align:left; font-weight:400;
}
.Normal-C
{
font-family:"Verdana", sans-serif; font-size:16.0px;
line-height:1.13em; color:#736357;
}
-->
</style>
</head>

<body text="#000000" style="background: #ffffff; text-align:center; height:1000px;">
<div style="background: #e7c1d7; position:relative;width:600px;height:1000px;margin-left:auto;margin-right:auto;">
<div id="txt_1" style="position:absolute; left:49px; top:67px; width:499px; height:140px;-moz-box-sizing:border-box;box-sizing:border-box; overflow:hidden;">
<P class="Normal-P"><span class="Normal-C">L&#x2019;ébauche d&#x2019;une nouvelle année pointe son nez....</span></P>
<P class="Normal-P"><span class="Normal-C">La tribu vous souhaite des brassées de plaisirs et de bonne humeur,</span></P>
<P class="Normal-P"><span class="Normal-C">des paniers remplis de petits et grands bonheurs pour en profiter et en abuser sans
modération.</span></P>
<P class="Normal-P"><span class="Normal-C">Très bonne et heureuse année 2010.</span></P>
</div>
<div style="position:absolute; left:48px; top:244px; width:488px; height:488px;">
<img src="wpimages/wp0874501d_0f.jpg" width="488" height="488" border="0" id="pic_1" name="pic_1" title="" alt=""></div>
<div style="position:absolute; left:90px; top:-20px; width:479px; height:94px;">
<div id="frag_6" style="text-align:left;">
<html>
<head>
<script language="JavaScript">
// Placez le nombre de flocons de neige (plus de 30 - 40 non recommandés)
var snowmax=35

// Placez les couleurs pour la neige. Ajoutez autant de couleurs comme vous voudrez
var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")

// Placez les polices, celle créent les flocons de neige. Ajoutez autant de polices comme vous voudrez
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")

// Placez la lettre qui crée votre flocon de neige (recommandé: *)
var snowletter="*"

// Placez la vitesse de la descente (gamme recommandée de valeurs de 0,3 à 2)
var sinkspeed=2

// Placez la maximal-taille de vos snowflaxes
var snowmaxsize=30

// Placez la minimal-taille de vos snowflaxes
var snowminsize=10

// Placez la neiger-zone
// Placez 1 pour tout-au-dessus-neiger, placez 2 pour la gauche-côté-chute de neige
// L'ensemble 3 pour centre-neiger, a placé 4 pour la droit-côté-chute de neige
var snowingzone=1

///////////////////////////////////////////////////////////////////////////
// LA CONFIGURATION FINIT ICI
///////////////////////////////////////////////////////////////////////////


// N'éditez pas au-dessous de cette ligne
var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/)
var browserok=ie5||ns6||opera

function randommaker(range) {
rand=Math.floor(range*Math.random())
return rand
}

function initsnow() {
if (ie5 || opera) {
marginbottom = document.body.clientHeight
marginright = document.body.clientWidth
}
else if (ns6) {
marginbottom = window.innerHeight
marginright = window.innerWidth
}
var snowsizerange=snowmaxsize-snowminsize
for (i=0;i<=snowmax;i++) {
crds = 0;
lftrght = Math.random()*15;
x_mv = 0.03 + Math.random()/10;
snow=document.getElementById("s"+i)
snow.style.fontFamily=snowtype[randommaker(snowtype.length)]
snow.size=randommaker(snowsizerange)+snowminsize
snow.style.fontSize=snow.size
snow.style.color=snowcolor[randommaker(snowcolor.length)]
snow.sink=sinkspeed*snow.size/5
if (snowingzone==1) {snow.posx=randommaker(marginright-snow.size)}
if (snowingzone==2) {snow.posx=randommaker(marginright/2-snow.size)}
if (snowingzone==3) {snow.posx=randommaker(marginright/2-snow.size)+marginright/4}
if (snowingzone==4) {snow.posx=randommaker(marginright/2-snow.size)+marginright/2}
snow.posy=randommaker(2*marginbottom-marginbottom-2*snow.size)
snow.style.left=snow.posx
snow.style.top=snow.posy
}
movesnow()
}

function movesnow() {
for (i=0;i<=snowmax;i++) {
crds += x_mv;
snow.posy+=snow.sink
snow.style.left=snow.posx+lftrght*Math.sin(crds);
snow.style.top=snow.posy

if (snow.posy>=marginbottom-2*snow.size || parseInt(snow.style.left)>(marginright-3*lftrght)){
if (snowingzone==1) {snow.posx=randommaker(marginright-snow.size)}
if (snowingzone==2) {snow.posx=randommaker(marginright/2-snow.size)}
if (snowingzone==3) {snow.posx=randommaker(marginright/2-snow.size)+marginright/4}
if (snowingzone==4) {snow.posx=randommaker(marginright/2-snow.size)+marginright/2}
snow.posy=0
}
}
var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
window.onload=initsnow
}
</script>
<title>Neige :P</title>
</head>
<body>

</body>
</html>
</div></div>
</div>
</body>
</html>

Titre: Re:script java dans une newsletter
Posté par: pelocain le le 13-01-2010 a 11:01:18

Ce n'est pas du tout la réponse que tu cherche mais beaucoup des pros de la newsletter avec qui je bosse te diraient de ne pas mettre de script dans une newsletter.
Elle va partir en spam directement.

Titre: Re:script java dans une newsletter
Posté par: KanoKa le le 13-01-2010 a 12:35:01

merci pour tes précisions.
Je m'en suis rendue compte toute seule.
J'ai contourné le problème en mettant un lien vers la page html.
Outlook bloque les scripts. Idem pour un objet en .flash ou swis..
On apprend en tatonnant.
merci quand même


Forum-webmaster | Actionné par YaBB SE
© 2001-2003, YaBB SE Dev Team. Tous droits réservés.