$('.sample2').click( function() {
var _this = $(this),
href = _this.attr('href'),
text = _this.attr('data-text'),
num = _this.attr('data-num');
/*if(typeof num == "undefined")
alert("Undefined");
else
alert("Not undefined");
*/
$.ajax({
type: 'POST',
url: 'zakaz.php?action=new',
data: 'cookies=num&id_tovar=' + text +'text&kol_vo=' + num + '&del=0',
success: function (data) {
$('.results').html(data);
}
});
});
Вот так работает. Понять почему первый вариант не работал.
Спасибо дали толчек и знания)