Mọi người cho mình hỏi đoạn javascript sau mình debug trên visual không chạy ( mình đã đặt trust size ở IE và enable script). Khi mình viết lại trên notepad thì chạy được. Không biết mình lỗi ở đâu:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JavaScriptControl._Default" %>
<!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 runat="server">
<title></title>
<style type="text/css" >
p { color:red; margin:5px; cursor:pointer; }
p.hilite { background: yellow; }
</style>
<script type="text/javascript" src="Script/jquery-1.4.1.js">
$("p").hover(function() {
$(this).addClass("hilite");
}, function() {
$(this).removeClass("hilite");
});
</script>
</head>
<body>
<form runat="server">
<div>
<p>First Paragraph</p>
<p>Second Paragraph</p>
<p>Yet one more Paragraph</p>
</div>
</form>
</body>
</html>
Muốn biết lỗi do đâu thì phải "debug" chứ :)
Cài đặt "fire bug" hay "IE Developer tool bar về rồi step by step mà check
Hi !
Cảm ơn anh Hải, em đã sửa được rồi.