HTML
<!DOCTYPE html>
<html lang="vi" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
</head>
<body></body>
</html>
JS Simple 1
<script type="text/javascript">
WebFontConfig = {
google: { families: ['Open+Sans:400,400italic,700,800,300,600&subset=latin,vietnamese,latin-ext']}
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
JS Simple 2
<script>
$( document ).ready(function() {
var productId = '18707';
$.ajax({
url: base_url + '/order/loadInfo',
type: 'POST',
dataType: 'html',
data: {product_id: productId},
success: function(data, textStatus, xhr) {
$("#khuyenmai").html(data);
},
error: function(xhr, textStatus, errorThrown) {
$.fancybox.showLoading();
}
});
$.ajax({
url: base_url + '/ajax/dexuat',
type: 'POST',
dataType: 'json',
data: {
'key': 'detail',
'title': 'Đề xuất cho bạn',
'product_id' : productId,
'retailer_id': '197',
'category_id': '40',
'product_type': 'Array',
'price_core': 'Array',
'price_sell': 'Array',
'category_parent': '27'
},
success: function(data) {
if(data.code == 'true'){
$('body').find('#dexuatchoban').html(data.html);
}
},
error: function(xhr) {
}
});
});
</script>
JS Simple 3
<script>
document.onkeydown=function(evt){
var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) : event.keyCode;
if(keyCode == 13)
{
//your function call here
document.search.submit();
}
}
</script>