Current File : /home/tradevaly/demo.tradevaly.com.bd/public/frontend/js/custom-frontend.js |
$('.link-hover-dark-white').click( function() { // index page
var selectText = $(this).text();
selectText = selectText.replace(/\s/g, '');
if( selectText == 'Products' ){
selectText = 'product';
}else if( selectText == 'Companies' ){
selectText = 'company';
}else{
selectText = 'buyer';
}
$('.region').attr("placeholder", 'Enter '+selectText+ ' name');
});
$( "#main-search-form" ).submit(function( event ) { // index page
var what = $('#what').val();
var keyword = $('#keyword').val();
if( what === '' ){
alert('Select what service.');
event.preventDefault();
} else if( keyword === '' ){
alert('Select keyword.');
event.preventDefault();
}
});
function loadHotCategory(BASEURL) {
//alert('Response');
$.ajax({
url: BASEURL + "/hot-product-category-list/",
datatype: "html",
type: "get",
beforeSend: function () {
$('.auto-load-list-product').show();
}
})
.done(function (response) {
$('.auto-load-list-product').hide();
$("#data-wrapper-list-product").append(response.data);
if ( response.grand_total == 0 ) {
$('.finished-list-product').html("Data not found :(");
}
})
.fail(function (jqXHR, ajaxOptions, thrownError) {
console.log('Server error occured');
});
}
function loadPopularSearch(BASEURL) {
//alert('Response');
$.ajax({
url: BASEURL + "/popular-search/",
datatype: "html",
type: "get",
beforeSend: function () {
$('.auto-load-list-popular').show();
}
})
.done(function (response) {
$('.auto-load-list-popular').hide();
$("#data-wrapper-list-popular").append(response.data);
if ( response.grand_total == 0 ) {
$('.finished-list-popular').html("Data not found :(");
}
})
.fail(function (jqXHR, ajaxOptions, thrownError) {
console.log('Server error occured');
});
}