|
|
|
การส่งค่า javascript เมื่อคลิกปุ่ม ไปยัง php ครับ |
|
|
|
|
|
|
|
<a href="menu.php?id=1" id="nav_menu_1" class="btn-menu-1">
2
3
4
5
|
|
|
|
|
Date :
2014-09-25 13:45:38 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.getJSON(url,parameter,function(){..................});
Code (JavaScript)
$.getJSON(serviceURL + 'menu.php',{id:id,name:name}, function({
/*........................*/
});
|
|
|
|
|
Date :
2014-09-25 14:28:47 |
By :
LuckyStar |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ แก้ไขได้เเล้วครับ
Code (JavaScript)
<ul>
<!--li><a href="" id="nav_menu_1" class="btn-menu-1"></a></li-->
<li><a href="" data-icon="menu-1" id="nav_menu_1">ต่างหูมุก</a></li>
<li><a href="" data-icon="menu-2" id="nav_menu_2">สร้อยข้อมือมุก</a></li>
<li><a href="" data-icon="menu-3" id="nav_menu_3">สร้อยมุก</a></li>
<li><a href="" data-icon="menu-4" id="nav_menu_4">จี้มุก</a></li>
<li><a href="more.html" rel="external" data-icon="menu-5" id="nav_menu_5">เพิ่มเติม</a></li>
</ul>
$('#nav_menu_1').click(function(page){
//v = $(this).text();
var page = 1;
getEmployeeList(page);
});
$('#nav_menu_2').click(function(page){
var page = 2;
getEmployeeList(page);
});
$('#nav_menu_3').click(function(page){
var page = 3;
getEmployeeList(page);
});
$('#nav_menu_4').click(function(page){
var page = 4;
getEmployeeList(page);
});
$('#nav_menu_5').click(function(){
window.location.href='more.html';
});
function getEmployeeList(page) {
var mypage = page;
$.getJSON(serviceURL + 'menu.php?id=' + mypage, function(data) {
.......
});
}
|
|
|
|
|
Date :
2014-10-01 10:17:46 |
By :
pure7021 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2014-10-01 10:24:47 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แบบนี้ ดี กว่า
Code (JavaScript)
<ul>
<!--li><a href="" id="nav_menu_1" class="btn-menu-1"></a></li-->
<li><a href="" data-icon="menu-1" id="nav_menu_1" data-page="1" >ต่างหูมุก</a></li>
<li><a href="" data-icon="menu-2" id="nav_menu_2" data-page="2" >สร้อยข้อมือมุก</a></li>
<li><a href="" data-icon="menu-3" id="nav_menu_3" data-page="3" >สร้อยมุก</a></li>
<li><a href="" data-icon="menu-4" id="nav_menu_4" data-page="4" >จี้มุก</a></li>
<li><a href="more.html" rel="external" data-icon="menu-5" id="nav_menu_5" data-page="more" >เพิ่มเติม</a></li>
</ul>
$('a[id*="nav_menu_"]').click(function(){
if($(this).data('page') == 'more'){
window.location.href='more.html';
}else{
getEmployeeList($(this).data('page'));
}
});
function getEmployeeList(page) {
$.getJSON(serviceURL + 'menu.php?id=' + page, function(data) {
.......
});
|
|
|
|
|
Date :
2014-10-01 14:33:00 |
By :
gaowteen |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|