开发者

Running javascript in Content Page

开发者 https://www.devze.com 2023-02-11 10:11 出处:网络
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.

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

精彩评论

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