เกี่ยวกับการ loadsection
¼Áãªé¿Ñ§¡ìªÑ¹ loadsection 㹡ÒÃâËŴ˹éÒãËÁè¢Öé¹ÁÒ code ¡é»ÃÐÁÒ³¢Í§ÍÒ¨ÒÃÂì¹èФÃѺ
function loadsection(module,layer){
Set_Cookie('module',module);
Set_Cookie('display',layer);
var req=Inint_AJAX();
var layer = document.getElementById(layer)
layer.innerHTML=
'<div id="wait" align="center"><img src="images/wait4.gif" alt="" /><br /><br />Loading...</div>';
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
var data = req.responseText;
layer.innerHTML = data;
}
};
req.open("GET", module, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); // set Header
req.send(null);
}
áÅéÇ¡çä» à¡çº cookie Çèҵ͹¹ÕéÍÂÙè˹éÒä˹ »ÑËÒ¡ç¤×ÍÇèÒ ¶éÒ¼Áµéͧ¡ÒÃÊè§ parameter ä»´éÇÂàªè¹ loadsection('a.php?d=1&b=7&v=9','display');
cookie Áѹ¨Ðà¡çÂä´é੾ÒФèÒáá¡é¤×Í a.php?d=1 µÑÇËÅѧÁѹ¨ÐäÁè¨Ó¤èÒµéͧ·ÓÂѧ䧤ÃѺ
function loadsection(module,layer){
Set_Cookie('module',module);
Set_Cookie('display',layer);
var req=Inint_AJAX();
var layer = document.getElementById(layer)
layer.innerHTML=
'<div id="wait" align="center"><img src="images/wait4.gif" alt="" /><br /><br />Loading...</div>';
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
var data = req.responseText;
layer.innerHTML = data;
}
};
req.open("GET", module, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); // set Header
req.send(null);
}
áÅéÇ¡çä» à¡çº cookie Çèҵ͹¹ÕéÍÂÙè˹éÒä˹ »ÑËÒ¡ç¤×ÍÇèÒ ¶éÒ¼Áµéͧ¡ÒÃÊè§ parameter ä»´éÇÂàªè¹ loadsection('a.php?d=1&b=7&v=9','display');
cookie Áѹ¨Ðà¡çÂä´é੾ÒФèÒáá¡é¤×Í a.php?d=1 µÑÇËÅѧÁѹ¨ÐäÁè¨Ó¤èÒµéͧ·ÓÂѧ䧤ÃѺ
function loadsection(module,layer){
Set_Cookie('module',module);
Set_Cookie('display',layer);
var req=Inint_AJAX();
var layer = document.getElementById(layer)
layer.innerHTML=
'<div id="wait" align="center"><img src="images/wait4.gif" alt="" /><br /><br />Loading...</div>';
req.onreadystatechange = function () {
if (req.readyState==4) {
if (req.status==200) {
var data = req.responseText;
layer.innerHTML = data;
}
};
req.open("GET", module, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); // set Header
req.send(null);
}
แล้วก้ไปเก็บcookie ว่าตอนนี้โหลดเพจไหนอยู่ แต่ปัญหามันประมาณว่าถ้าผมส่งค่า parameter ไปด้วยเช่น loadsection('a.php?d=1&b=7&v=9','display');
cookie cookie มันจะจำแค่ค่าแรกอย่างเดียวคือจำแค่ a.php?d=1 โดยตัวหลังมันไม่จำน่ะครับ แก้ยังไงคัฟ