In my ASP.Net 2008 app I've got a page that uses a Master Pa开发者_JAVA百科ge and I want to use jquery/javascript but I can't even get this simple code to work. the page loads and controls display but no alert.
Ideas?
<asp:Content ContentPlaceHolderID="cphMain" runat="server" ID="mainBodyContent">
<script type="text/javascript" src="../../js/jquery-1.4.1.js">
$(document).ready(function() {
alert("Hey");
});
</script>
....
other controls
...
You can either have the src
attribute set of the script element or have it contain script in its body. Not both in the same time.
精彩评论