PDA

View Full Version : سوال: استفاده از فایل js خارجی در html4



kamran_14
شنبه 07 مرداد 1391, 20:00 عصر
سلام
خسته نباشین
من این کدها رو تو notepad++ نوشتم ولی نمی دونم چرا وقتی روی دکمه کلیک می کنم برنامه هیچ عکس العملی نشون نمی ده. می شه کمکم کنید؟ من تازه می خوام جاوا اسکریپت رو بخونم امّا همین اولش موندم .
متن فایل index.js

<script type="text/javascript" language="javascript">
function hello2()
{
document.write("wellcom to html ")
}
</script>
متن فایل index.html

<!DOCTYPE html>
<html>
<head>
<title>In the name of GOD</title>
<script type="text/javascript" src="index.js" language="javascript" charset="UTF-8">
</script>

</head>
<body>
<input value="click to Button" id="button" type="button" onclick="hello2()"/>
</body>
</html>

حامد مصافی
شنبه 07 مرداد 1391, 22:05 عصر
تگ script رو از فایل js حذف کنید