VeraciTek, Inc. - We Build Websites - WoW Gold - Debt Consolidation - Debt Consolidation - Debt Consolidation

PDA

View Full Version : What's wrong with this code??


Lexxi
Apr 25th 2007, 7:57 am
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>

<script language="JavaScript" type="text/javascript">

var wishlistCookie = "";

if(document.cookie && document.cookie != ""){
process_cookie()

function process_cookie(){
var whole_cookie = unescape(document.cookie);
var each_cookie = whole_cookie.split(";");

for (i=0; i < each_cookie.length; i++){

if (each_cookie[i].indexOf("wishlist") > -1){wishlistCookie = each_cookie[i]}

}
}
}
</script>


<script>

if (document.cookie != ""){
wishlist = document.cookie
}

var A= unescape(wishlistCookie).split(/ *& */);
var L=A.length, tem,temp;

var panArray=[];
for(var i=0;i<L;i++){
tem=A[i].split(/ *\: */);
temp=tem[1].split(/ *\= */);
panArray.push(['<img src="images/' + tem[0] + '.jpg" alt="' + temp[0] + '">' + '<h3>' + temp[0] + '</h3><p><a href="' + temp[1] + '.htm"> Product Page</a><hr>'])
}

document.write(panArray[0] + '<br/>' + panArray[1]+ '<br/>' + panArray[2]+ '<br/>' + panArray[3])



</script>

</body>
</html>


It wont show in firefox, and in all the others, the first image wont show up.

Help??

Logic Ali
Apr 26th 2007, 2:02 am
It wont show in firefox, and in all the others, the first image wont show up.

Help??Without seeing the expected format of the cookie, it's difficult to confirm that it's being parsed properly.
Have you tried alerting panArray to confirm that it contains what you expect?

Dude111
May 1st 2007, 10:35 am
I have tried it as an HTM and a PHP file and i see nothing in IE when i launch it.... (Im using MyIE2 in front of IE)