I can't seem to pinpoint why this is failing - any ideas? -> See within .aspx
custom.master references / and script
<link rel="stylesheet" href="/admin/css/custom.css" />
<script src="/admin/js/jquery-1.9.1.min.js"></script>
<script src="/admin/js/jquery-1.10.2-ui.min.js"></script>
<link href="css/ui-lightness/jquery-ui-1.8.13.custom.css" rel="stylesheet"/>
<asp:ContentPlaceHolder ID="HeadPlaceHolder" runat="server"></asp:ContentPlaceHolder>
<script>
$(function () {
var $ = jQuery.noConflict(); <-- This here is the culprit
Within rPage.aspx (MasterPageFile="~/admin/custom.master")
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
<link href="css/bootstrap-3.3.5.min.css" rel="stylesheet" />
</asp:Content>
<script>
$(function () {
var $ = jQuery.noConflict(); //**Without this line the next line fails**
$("#<%= txtStartDate.ClientID %>").datepicker();
Error:
from console: TypeError: $ is not a function rPage:380:13
from debugger firefox dev edition:
378 $(function () {
379 //var $ = jQuery.noConflict();
380 $("#ContentPlaceHolder_txtStartDate").datepicker();
$to be jQuery in the global scope.$is being overwritten at some point between line 378 being executed and the DOM Ready event triggering the function that includes line 380. You haven't provided enough code to tell where.$(function() {works, and jQ passes a reference to itself as the first argument to the callback, you can write$(function($) {orjQuery(function($) {, which is the more common approach when you have conflicts. It's likely that the$name in your$(function() {isn't the jQ object to begin with (prototype uses$, too I think)