par
Chile » 24 juin 2017, 04:19
Bonjour,
Je tente de reduire le nombre de script javascript sur mes pages en les passant sur un fichier .js, avec un lien vers ce fichier, mais certains ne fonctonne pas une fois sur le fichier.
J'imagine qu'il faut les modifier. Ou puis je trouver des bases et astuces ? merci
Code : Tout sélectionner
<SCRIPT LANGUAGE="JavaScript">
<!--
function PopupImage(img) {
titre="Agrandissement";
w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+40,document.images[0].height+70); window.focus();} else { setTimeout('checksize()',150) } }</"+"SCRIPT>");
w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt='Mon image'>");
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>");
w.document.close();
}
//-->
</SCRIPT>
Code : Tout sélectionner
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'xxxxxxxxx', 'auto');
ga('send', 'pageview');
</script>
Bonjour,
Je tente de reduire le nombre de script javascript sur mes pages en les passant sur un fichier .js, avec un lien vers ce fichier, mais certains ne fonctonne pas une fois sur le fichier.
J'imagine qu'il faut les modifier. Ou puis je trouver des bases et astuces ? merci
[code]<SCRIPT LANGUAGE="JavaScript">
<!--
function PopupImage(img) {
titre="Agrandissement";
w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+40,document.images[0].height+70); window.focus();} else { setTimeout('checksize()',150) } }</"+"SCRIPT>");
w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt='Mon image'>");
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>");
w.document.close();
}
//-->
</SCRIPT>[/code]
[code]<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'xxxxxxxxx', 'auto');
ga('send', 'pageview');
</script>[/code]