max300647
Messages postés2Date d'inscriptionvendredi 7 janvier 2005StatutMembreDernière intervention17 novembre 2008
-
17 nov. 2008 à 10:02
PetoleTeam
Messages postés3426Date d'inscriptionlundi 26 décembre 2005StatutMembreDernière intervention14 janvier 2011
-
18 nov. 2008 à 18:36
Bonjour
J'utilise un code javascript écrit par Zhong Yang et optimisé par Guy Cappra. Ce code qui permet de voir le "panier" fonctionne bien sur IE, Firefox , Safari, Navigator ou Chrome sauf sur Opera 9.62 et je n'arrive pas à trouver le bug (je débute sur javascript). Il m'écrit bien la ligne d'entête du tableau, mais pas les lignes des produits commandés. Pourriez vous m'aider?
Voici le code:
function view_cart() {
mycookies= new Array(20);
var i=0;
var startpoint=0;
whole_len=document.cookie.length;
while(whole_len!=startpoint && i< 20)
{
if ((temlen=document.cookie.indexOf(";",startpoint))!=-1)
{
mycookies[i]=document.cookie.substring(startpoint,temlen);
i++;
startpoint=temlen+1
}
else if (startpoint != whole_len)
{
mycookies[i]=document.cookie.substring(startpoint,whole_len);
i++;
startpoint=whole_len;
}
}
printtitle();
for (j=0;j");
}
function getCookie (acookie) {
clen = acookie.length;
nlen= acookie.indexOf("=",0);
//get rid of the "crea" at the beginning, thus start at 4
if(acookie.substring(0,1)==" ")
cname=acookie.substring(5,acookie.indexOf("=",0));
else
cname= acookie.substring(4,acookie.indexOf("=",0));
bname= acookie.substring(acookie.indexOf("=",0)+1,acookie.length);
sname_len=cname.indexOf("+",0);
store=cname.substring(0,cname.indexOf("+",0));
dlen=cname.indexOf("+",cname.indexOf("+",0)+1);
descrip=cname.substring(cname.indexOf("+",0)+1,cname.indexOf("+",cname.indexOf("+",0)+1))
product=cname.substring(cname.indexOf("+",cname.indexOf("+",0)+1)+1,acookie.indexOf("=",0));
function putback(str1){
document.cookie="crea"+str1+"; path=/"+"";
}
// There's no need to touch anything above this line
// You can use "cname.substring(0,cname.indexOf("+",0))","descrip","product","quant","price"
// and "refer" in the code below
//add a field so that shopper can change amount of product in cart
function printcontent2(){
if(quant!=0){
document.write("<tr align=center><td>"+product+"</td><td>");
document.write(descrip+"</td><td><form method=get ");
document.write("action=voir.html>");
document.write("");
document.write("</td><td>");
document.write(price+"</td><td>"+"[+refer+ "+store+"]");
document.write("</td><td>");
document.write("</form></td></tr>");
}
}
function price_format(tmpprice){
// get rid off the extra digits behind "."
dot = tmpprice.toString().indexOf(".");
if(dot!=-1)
tmpprice=tmpprice.toString().substr(0,dot+4);
tmpprice=Math.round(tmpprice*100)/100;
// add "0" if necessary
dot = tmpprice.toString().indexOf(".");
if(dot ==-1)
tmpprice=tmpprice.toString()+".00";
else if((tmpprice.toString().length-dot)==2)
tmpprice=tmpprice.toString()+"0";
return tmpprice;
}
//add a field so that shopper can change amount of product in cart
function printcontent2(){
if(quant!=0){
document.write("<tr align=center><td>"+product+"</td><td>");
document.write(descrip+"</td><td><form method=get ");
document.write("action=voir.html>");
document.write("");
document.write("</td><td>");
document.write(price+"</td><td>"+"[+refer+ "+store+"]");
document.write("</td><td>");
document.write("</form></td></tr>");
}
}
function price_format(tmpprice){
// get rid off the extra digits behind "."
dot = tmpprice.toString().indexOf(".");
if(dot!=-1)
tmpprice=tmpprice.toString().substr(0,dot+4);
tmpprice=Math.round(tmpprice*100)/100;
// add "0" if necessary
dot = tmpprice.toString().indexOf(".");
if(dot ==-1)
tmpprice=tmpprice.toString()+".00";
else if((tmpprice.toString().length-dot)==2)
tmpprice=tmpprice.toString()+"0";
return tmpprice;
}
PetoleTeam
Messages postés3426Date d'inscriptionlundi 26 décembre 2005StatutMembreDernière intervention14 janvier 201117 18 nov. 2008 à 18:36
Bonjour,
Rien de ce que je peux lire ne concerne
un quelconque navigateur en particulier...
Est ce que la configuration de
ton Opéra accepte les cookies ?
;O)