Friday, April 17, 2015

javascript in master page

Add JavaScript between head then F12 to check if it is loaded. and the JavaScript is available for all content pages.


<head runat="server">
    <title>my page</title>
    <link href="~/styles.css" type="text/css" rel="stylesheet" />
    <link href="~/Scripts/jquery-ui-1.8.13.custom.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery-1.6.1.js") %>'></script>
    <script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery-ui-1.8.13.custom.min.js") %>'></script>
    <script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery.watermark-1.2.2.js") %>'></script>
     <script type="text/javascript">    
        function masterPageShowError(error) {
            var stackTrace = error.get_stackTrace();
            var message = error.get_message();
            var statusCode = error.get_statusCode();
            var exceptionType = error.get_exceptionType();
            var timedout = error.get_timedOut();
            alert(message);  
          }
     </script>
</head>

No comments:

Post a Comment