Reputation: 631
I have this code in my page.
$(document).ready(function () {
$("#ba_object_Code").change(function () { $("#HRBK").val($(this).val()); });
$.cookie('cookie_name', 'cookie_value');
if (sessid == 'xyz') {
$("#ControlPlanID").removeAttr('disabled');
}
$(".t-grid-action.t-button.t-state-default.t-grid-add").click(function () {
$.cookie('sessid', 'xyz');
});
});
I am getting this error
Microsoft JScript runtime error: Object doesn't support this property or method
Upvotes: 2
Views: 3573
Reputation: 11
order is important and jquery files have to be included in_layout.cshtml incase master page is used... 'JQuery' is undefined
Upvotes: 1
Reputation: 13134
Your not defining sessid, so when you call it, it will fail.
See working example: http://jsfiddle.net/zNDHN/
$(document).ready(function () {
var sessid = $.cookie('sessid');
$("#ba_object_Code").change(function () { $("#HRBK").val($(this).val()); });
$.cookie('cookie_name', 'cookie_value');
if (sessid == 'xyz') {
$("#ControlPlanID").removeAttr('disabled');
console.log('cookie_found');
}
$(".t-grid-action.t-button.t-state-default.t-grid-add").click(function () {
$.cookie('sessid', 'xyz');
console.log('cookie_created');
});
});
Upvotes: 1