PDA

View Full Version : مبتدی: کار نکردن کد



css-man
سه شنبه 01 آذر 1390, 20:09 عصر
من تازه شروع کردم به یاد گیری جاوااین برنامه کوچیک رو نوشتم ولی کار نمی کنه اگه میشه ببینید ایرادش ک



<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<script language="javascript1.5">
color = "b";
switch(color)
{
case 'b';
case 'B';
document.write('<br><b/>Your intrested is blue color');
break;

case 'r';
case 'R';
document.write('<br>Your intrested is red color');
break;

case 'g';
case 'G';
document.write('<br>Your intrested is Green');
break;

case 'w';
case 'W';
document.write('<br>Your intrested is white color');
break;

default;
document.write('<br> character is illegal');
}

</script>
</body>
</html>

MSN_Issue
سه شنبه 01 آذر 1390, 23:31 عصر
دوست عزیز جلوی کیس ها بجای ; باید از : استفاده کنید ...!
مثلا بجای
case 'b';
case 'B';
document.write('<b/>Your intrested is blue color');
break;

باید بذارید :

case 'b':
case 'B':
document.write('<b/>Your intrested is blue color');
break;