(function($){
$.fn.smartCart = function(options) {
var options = $.extend({}, $.fn.smartCart.defaults, options);
return this.each(function() {
var obj = $(this);
// retrive all products
var url = "shoppingItems.json";//essentially new products
var products = $("input[type=hidden]",obj);//what is this for
});
};
})( jQuery );
The code which im not sure about is var products =$("input[type = hidden]",obj); From what i understand, this is a multiple selector which is being put into products, which i cant see a use of. obj is simply a empty div tag in whihc i call from my html
<script type="text/javascript">
$(document).ready(function(){
// Call Smart Cart instead of features maybe something more higher up to include more features
$('#featured').smartCart();
});
</script>
the <input> is comprised of a list of shopping items which i have now moved into json file(so i will soon not be needing to use input rather my json url)
Essentially i would like to know if var products is a multiple selector, and if so why. understanding this will make the transition to making it json rather than from html easier.

New Topic/Question
Reply



MultiQuote



|