|
 |
|
Ajax Load Web Page ลิงค์ javascript ไม่ทำงาน |
|
 |
|
|
 |
 |
|
โค๊ดด้วยจร๊
|
 |
 |
 |
 |
Date :
2013-04-19 20:15:23 |
By :
dekkuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Plexjor.com </title>
<link rel="stylesheet" href="css/body.css">
<link rel="stylesheet" href="css/smoothness/jquery-ui-1.7.2.custom.css" />
<link href="css/lightbox.css" rel="stylesheet" />
<link href="pic/icon.ico" rel="shotcut icon" />
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui.js"></script>
<script language="JavaScript" src="js/myjavascript.js"></script>
<!---------------------color box ------------------->
<link rel="stylesheet" href="css/colorbox.css" />
<script src="js/jquery.colorbox.js"></script>
<?php include("colorbox.php"); ?>
<!---------------------color box ------------------->
<!---------------------Tab ------------------->
<script type="text/javascript">
$(function(){
$('#tabs').tabs();
});
</script>
<!---------------------Tab ------------------->
<script language="JavaScript">
var HttPRequest = false;
function doCallAjax(url) {
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
var pmeters = "";
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
HttPRequest.send(pmeters);
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 3) // Loading Request
{
document.getElementById("mySpan").innerHTML = "Now is Loading...";
}
if(HttPRequest.readyState == 4) // Return Request
{
document.getElementById('mySpan').innerHTML = HttPRequest.responseText;
}
}
</script>
</head>
<body>
<span id="mySpan">
</body>
</html>
อันนี้ตัว Index ครับ
Code (PHP)
<link rel="stylesheet" href="css/smoothness/jquery-ui-1.7.2.custom.css" />
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-ui.js"></script>
<link rel="stylesheet" href="css/body.css">
<!---------------------color box ------------------->
<link rel="stylesheet" href="css/colorbox.css" />
<script src="js/jquery.colorbox.js"></script>
<?php include("colorbox.php"); ?>
<!---------------------color box ------------------->
<!---------------------Tab ------------------->
<script type="text/javascript">
$(function(){
$('#tabs').tabs();
});
</script>
<!---------------------Tab ------------------->
<div class="head_ct"></div>
<div class="content_ct"><div class="sp"></div>
<div class="news"><marquee direction="left" scrollamount="4"><font size="5px" color="#ff0000">ประกาศ : ขอสงวนสิทธิในการไม่เผยแพร่ภาพยนต์ซูม-ชนโรง โดยช่วยกันไปดูที่โรงภาพยนต์นะครับ</font></marquee></div>
<div class="clear-all"></div>
</div>
<div class="content_ct">
<div id="tabs">
<ul>
<li><a href="#tabs-1">ต่างประเทศ</a></li>
<li><a href="#tabs-2">ไทย</a></li>
<li><a href="#tabs-3">อนิเมชัน</a></li>
<li><a href="#tabs-4">คอนเสิร์ต</a></li>
</ul>
<div id="tabs-1">
<?php
$sql = "select * from $tb where type='en' ORDER BY id DESC LIMIT 12";
$result = mysql_query ( $sql, $condb );
while ( $rs = mysql_fetch_array ( $result ) )
{
$id=$rs[id];
$type=$rs[type];
?>
<div class="poster">
<img src="<?php echo "$rs[poster]"?>">
<div class="name">
<div class="name_en"><?php echo "$rs[name_en]"?></div>
<div class="name_th"><?php echo "$rs[name_th]"?></div>
<div class="view">
<a href="JavaScript:doCallAjax('detail.php?id=<?php echo "$id"?>');"><div class="vi"></div></a>
<a class="youtube" href="http://www.youtube.com/embed/<?php echo "$rs[exam]"?>?;autoplay=1;rel=0" title="<?php echo "$rs[name_en]"?> <?php echo "$rs[name_th]"?>"><div class="ex"></div></a>
<div class="clear-all"></div>
</div>
</div>
</div>
<?php } ?>
<div class="clear-all"></div>
<div class="more"><a href="more.php?type=en">ดูทั้งหมด...</a></div>
</div>
<div id="tabs-2">
<?php
$sql = "select * from $tb where type='th' ORDER BY id DESC LIMIT 12";
$result = mysql_query ( $sql, $condb );
while ( $rs = mysql_fetch_array ( $result ) )
{
$id=$rs[id];
?>
<div class="poster">
<img src="<?php echo "$rs[poster]"?>">
<div class="name">
<div class="name_en"><?php echo "$rs[name_en]"?></div>
<div class="name_th"><?php echo "$rs[name_th]"?></div>
<div class="view">
<a href="detail.php?id=<?php echo "$id"?>"><div class="vi"></div></a>
<a class="youtube" href="http://www.youtube.com/embed/<?php echo "$rs[exam]"?>?;autoplay=1;rel=0" title="<?php echo "$rs[name_en]"?> <?php echo "$rs[name_th]"?>"><div class="ex"></div></a>
<div class="clear-all"></div>
</div>
</div>
</div>
<?php } ?>
<div class="clear-all"></div>
<div class="more"><a href="more.php?type=th">ดูทั้งหมด...</a></div>
</div>
<div id="tabs-3">
<?php
$sql = "select * from $tb where type='an' ORDER BY id DESC LIMIT 12";
$result = mysql_query ( $sql, $condb );
while ( $rs = mysql_fetch_array ( $result ) )
{
$id=$rs[id];
?>
<div class="poster">
<img src="<?php echo "$rs[poster]"?>">
<div class="name">
<div class="name_en"><?php echo "$rs[name_en]"?></div>
<div class="name_th"><?php echo "$rs[name_th]"?></div>
<div class="view">
<a href="detail.php?id=<?php echo "$id"?>"><div class="vi"></div></a>
<a class="youtube" href="http://www.youtube.com/embed/<?php echo "$rs[exam]"?>?;autoplay=1;rel=0" title="<?php echo "$rs[name_en]"?> <?php echo "$rs[name_th]"?>"><div class="ex"></div></a>
<div class="clear-all"></div>
</div>
</div>
</div>
<?php } ?>
<div class="clear-all"></div>
<div class="more"><a href="more.php?type=an">ดูทั้งหมด...</a></div>
</div>
<div id="tabs-4">
<?php
$sql = "select * from $tb where type='con' ORDER BY id DESC LIMIT 12";
$result = mysql_query ( $sql, $condb );
while ( $rs = mysql_fetch_array ( $result ) )
{
$id=$rs[id];
?>
<div class="poster">
<img src="<?php echo "$rs[poster]"?>">
<div class="name">
<div class="name_en"><?php echo "$rs[name_en]"?></div>
<div class="name_th"><?php echo "$rs[name_th]"?></div>
<div class="view">
<a href="detail.php?id=<?php echo "$id"?>"><div class="vi"></div></a>
<a class="youtube" href="http://www.youtube.com/embed/<?php echo "$rs[exam]"?>?;autoplay=1;rel=0" title="<?php echo "$rs[name_en]"?> <?php echo "$rs[name_th]"?>"><div class="ex"></div></a>
<div class="clear-all"></div>
</div>
</div>
</div>
<?php } ?>
<div class="clear-all"></div>
<div class="more"><a href="more.php?type=con">ดูทั้งหมด...</a></div>
</div>
</div>
<div class="clear-all"></div>
</div>
<div class="footer_ct"></div>
อันนี้ไฟล์ที่ดึงมา
|
ประวัติการแก้ไข 2013-04-19 20:29:14
 |
 |
 |
 |
Date :
2013-04-19 20:28:40 |
By :
newbasic |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กว่าจะเข้าใจคำถามเล่นเอางงตั้งนาน
หน้า index ที่โหลดมามันไปอยู๋ใน span ครับ script เลยอาจมีปัญหาได้ แนะว่าควรเอาไปรวมกันไว้าหน้าเดียวเลย เอาเฉพาะ script น่ะ
|
 |
 |
 |
 |
Date :
2013-04-19 21:27:15 |
By :
dekkuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแล้วอะครับผม ทั้งเอาไปรวมใน index หลัก และเอาไปรวมใน index ที่โหลดมา มันก็ไม่ได้อะครับ
|
 |
 |
 |
 |
Date :
2013-04-19 21:41:31 |
By :
newbasic |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รันบน ie แล้วดูว่า error อะไร
|
 |
 |
 |
 |
Date :
2013-04-19 22:16:45 |
By :
dekkuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่มีบอกอะครับ = =
|
 |
 |
 |
 |
Date :
2013-04-19 22:36:46 |
By :
newbasic |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|