 |
]รบกวนสอบถามหน่อยครับ คือผมต้องการจะให้โชว์รายละเอียดทั้งหมดอะครับ โดยคลอกที่ปุ่มด้านขวา แล้วจากนั้น ก็ให้ alert หรือ new windows |
|
 |
|
|
 |
 |
|
กำลังหมายถึงกดแล้วขึ้น POP UP ไช่ไหมครับ ตามโค้ดด้านล่างเลยครับ
ส่วนตัวแปรที่จะส่งก็พ่วงหลัง url ในรูปแบบ $_GET ไปได้เลย ส่วนการคิวรี่ก็ไปลงโค้ดเอาในไฟล์ที่ลิ้งที่ชี้ไป
640 450 คือขนาด กว้างยาวของ POPUPครับผม
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=no, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}
</script>
</head>
<body>
<a href="javascript:popup('xxxx.php?xxx=<?=$xxx?>','',650,450)">+++</a>
</body>
</html>
|
 |
 |
 |
 |
Date :
2013-09-03 15:01:10 |
By :
meannerss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
[size=10pt][b]ขอบคุรมากครับ เดี๋ยวจะลองดูนะครับ[/b][/size]
|
 |
 |
 |
 |
Date :
2013-09-03 18:44:09 |
By :
fanciful |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอโทษนะครับ มันไม่ขึ้นอะครับทำได้ดีครับ ไม่error เลย แล้วก็ไม่ขึ้นอะไร
|
 |
 |
 |
 |
Date :
2013-09-09 19:11:34 |
By :
fanciful |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือผมคิวรี่ข้อมูลออกมาเป็น table และแต่ละข้อมูลก้มีปุ่มกด จึงเอาไปใส่ใน each ขอ ajax ที่คิวรี่ออกมา ก้ยังไม่ได้นะครับ
Code (JavaScript)
<script type="text/javascript" src="js/jquery-1.7.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#YMonth').change(function() {
var table = document.getElementById('TBtraining');
//or use : var table = document.all.tableid;
for(var i = table.rows.length-1; i > 0; i--)
{
table.deleteRow(i);
}
var str = document.getElementById('YMonth').value;
var year = str.substring(0,4);
var month = str.substring(4,7);
var yearmonth =year+"-"+month;
// Perform an asynchronous HTTP (Ajax) request.
$.ajax({
// A string containing the URL to which the request is sent.
url: "webAction.php",
type:"POST",
// Data to be sent to the server.
data:({idAction:"viewData",valYearMonth:yearmonth}),
// The type of data that you're expecting back from the server.
dataType: "json",
// success is called if the request succeeds.
success:function(data){
// Iterate over a jQuery object, executing a function for each matched element.
$.each(data,function(index,value){
// Insert content, specified by the parameter, to the end of each element
// in the set of matched elements.
$('#TBtraining').append('<tr><td><p>Title: '+value.title+' Special Title: '+value.special_title+' DateTime: '+value.date+' '+value.time+'</p></td><td><p><center><a href=javascript:popup(popupDetail.php?detailCode='+value.title+',Detail,650,450)><img src=images/View-Detail.png /></a></center></p></td></tr>');
});
}
});
});
});
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/2:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=no, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}
</script>
|
 |
 |
 |
 |
Date :
2013-09-09 19:42:57 |
By :
fanciful |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|