How do I add JavaScript code to the template content page?

Source: Internet
Author: User

Today, I want to add a jqueryui control on the input tab of the content page to create a date selector by clicking the text box, however, no matter whether I put the JS Code in the template masterpage or in the contentplaceholder of the content page, the JS Code does not run normally and does not see the jquery effect. After repeated research, I come to the conclusion that, javaScript code must be placed in head contentplaceholder on the Content Page. For example, the Code is as follows:

<Asp: Content ID = "content1" contentplaceholderid = "head" runat = "server">
<Link href = "CSS/smoothness/jquery-ui-1.8.14.custom.css" rel = "stylesheet" type = "text/CSS"/>
<SCRIPT src = "JS/jquery-1.6.1.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/jquery-ui-1.8.14.custom.min.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
$ (Function (){
$ ("# <% = Txtbrithday. clientid %>"). datepicker ({
Changemonth: True,
Changeyear: True
});
$ ("# <% = Txtregdate. clientid %>"). datepicker ({
Showon: "button ",
Buttonimage: "images/calendar.gif ",
Buttonimageonly: True
});
});
</SCRIPT>
</ASP: content>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.