0
工作,我有一個形式上的工作,但是當我試圖把它的內容不再工作的javascript ..JavaScript是不是在內容
這裏的工作的javascript:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Numeric.aspx.cs" Inherits="Numeric" %>
<!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>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="Scripts/jquery.numeric.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<form>
Numbers only:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input class="numeric" type="text" />
<script type="text/javascript">
$("#TextBox1").numeric();
</script>
</form>
</div>
</form>
</body>
</html>
這裏不工作javascript in content:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="NumericNew.aspx.cs" Inherits="NumericNew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="Scripts/jquery.numeric.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" > </asp:ScriptManager>
<div>
Numbers only:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input class="numeric" type="text" />
<script type="text/javascript">
$("#TextBox1").numeric();
</script>
</div>
</asp:Content>
請讓我知道想法..謝謝。
形容「不加工」。應該發生什麼?發生什麼事?控制檯中的任何錯誤?你是如何調試你的代碼的? – elclanrs
請更新您的標題。您可以閱讀http://meta.stackexchange.com/questions/10647/how-do-i-write-a-good-title –
嘗試$(「#<%= TextBox1.ClientID%>」) –