开发者

Running javascript in Content Page

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜