" // ตรวจสอบว่าไม่ได้อยู่ที่หน้าแรก if (CurrentPage > 1) { ResulthtmlPage += "
"; } var pagesToShow = 10; // จำนวนหน้าที่ต้องการแสดง var startPage = Math.max(1, CurrentPage - Math.floor(pagesToShow / 2)); var endPage = Math.min(numberOfPages, startPage + pagesToShow - 1); for (var j = startPage; j <= endPage; j++) { if (j == CurrentPage) { ResulthtmlPage += "
"; } else { ResulthtmlPage += "
"; } } // ตรวจสอบว่าไม่ได้อยู่ที่หน้าสุดท้าย if (CurrentPage < numberOfPages) { ResulthtmlPage += "
"; } ResulthtmlPage += "" $("#divSearchPageResult").html(ResulthtmlPage); $("#searchItems").html(allItems); } }, error: function (data) { //console.log("error Predicsearch =>" + JSON.stringify(data)); } }); } } function SearchPage(type, pid) { var S_searchtext = $('input#txtSearch').val(); //console.log(pid); if (type != "") { var getlocation = window.location.origin + window.location.pathname; //console.log(getlocation); if (S_searchtext != false) { var SS_page = 1; if (pid != "") { SS_page = pid; } //url = getlocation + "?searchtext=" + S_searchtext + "&page=" + SS_page; //console.log(url); //window.location.href = url; var Obj = { searchText: S_searchtext, page: SS_page }; CallAgjaxSearch("Textsearch", Obj); } } } var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } return false; };
Use and Management of Cookies
We use cookies and other similar technologies on our website to enhance your browsing experience. For more information, please visit our Cookies Notice.
Accept