In My Meteor Project Session Set Array of Mapping Functions Return CloneNode Error!. Code is Here
var SubCategory = $(':checkbox[name=SubCategory]:checked').map(function() {
});
console.log(SubCategory);
Session.set( "subCategory", SubCategory);
And Console Output Here
["category1", "category2", prevObject: jQuery.fn.init[2]]
Error in Console: Uncaught TypeError: elem.cloneNode is not a function
I have Solve This Question.
SubCategory(event){
let checked = event.target.checked;
let subcategory= [];
var SubCategory = $(':checkbox[name=SubCategory]:checked').map(function(value,index) {
subcategory.push(index.value);
});
Session.set( "subCategory", subcategory);
}
Result in console:
["category1", "category2"]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.