What's wrong with this code??

This is a discussion on "What's wrong with this code??" within the JavaScript Forum section. This forum, and the thread "What's wrong with this code?? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 25th, 2007, 14:57
New Member
Join Date: Apr 2007
Location: UK
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
What's wrong with this code??

Code: Select all
<!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="http://www.webforumz.com/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??

Last edited by karinne; Apr 25th, 2007 at 15:00. Reason: Please use [code]...[/code] tags when displaying code!
Reply With Quote

  #2 (permalink)  
Old Apr 26th, 2007, 01:07
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to snow
Re: What's wrong with this code??

As a beginning - javascript functions have to be declared in the <head> section of your code...

May I recommend the web developer toolbar extension for your firefox browser? It'll give you a nice little console telling you where all the errors are in the code with their line numbers.

All the best with it,
Snow
Reply With Quote
Reply

Tags
firefox

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What have I done wrong in this code? acrikey JavaScript Forum 6 Mar 23rd, 2008 22:39
What is wrong with my code acrikey Flash & Multimedia Forum 9 Jul 30th, 2007 16:19
AAArrrgggg....what;s wrong with this code murf JavaScript Forum 2 Nov 25th, 2006 00:50
what is wrong with this code inusrat JavaScript Forum 0 Jun 28th, 2006 13:18
Can somebody give me the code to hide the source code? renren JavaScript Forum 7 Mar 7th, 2006 12:27


All times are GMT. The time now is 22:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43