|
|
|
javascript ไม่รันใน IE ครับ ไม่ทราบว่าเปนเพราะ css หรือ version ของ jquery หรือเปล่า ... |
|
|
|
|
|
|
|
คือ script ไม่รันใน ie น่ะครับ
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="src/jquery-ui-1.8.22.custom.min.js"></script>
<link href="src/jquery-ui-1.8.22.custom.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
$(document).ready(function(){
//alert(5);
var d1,s1,s2,textvalue,icheck = 0,ps1,lbdata;
var table1 = false,table2 = false;
var collection = new Array();
var lv = new Array();
//var id = "";
//var url = top.window.location;
//var handleID = strSplit(url,"lirt/");
//alert(url);
var iurls = "/handle/lirt/16687?show=full";
var isplit = strSplit(iurls,"lirt/");
var ihandle = strSplit(isplit[1],"?");
$.ajax({
url:"lib/helper.php?process=getItem&id="+ihandle[0],
success:function(data){
//alert(data);
if(data != 0){
// ps1 = strSplit(data,'{Relation}');
// lbdata = strSplit(ps1[1],',');
//document.getElementById('#lb1').innerHTML = "55" ;
//$('#lb1').html(lbdata[0]);
//$('#lb2').html(lbdata[1]);
d1 = strSplit(data,',');
for(var z=0;z<d1.length;z++){
s1 = strSplit(d1[z],'|');
//alert(s1);
if(collection.length == 0){
collection[0] = s1[0];
lv[0] = s1[3];
if(s1[3] == 47){
$('td#td1').append('<li style="padding:0px;margin:0px;" id="1'+s1[0]+'" value="0" ><span id="p1'+s1[0]+'" class="ui-icon ui-icon-carat-1-e" value="0" ></span><a onmouseover="this.style.color=\'#EB8F00\';" onmouseout="this.style.color=\'#333333\';" href="#" onclick="javascript:Toggle(1'+s1[0]+')">'+s1[1]+'</a><ul ></ul></li>');
table1 = true;
}else{
$('td#td2').append('<li style="padding:0px;margin:0px;" id="2'+s1[0]+'" value="0" ><span id="p2'+s1[0]+'" class="ui-icon ui-icon-carat-1-e" value="0" ></span><a onmouseover="this.style.color=\'#EB8F00\';" onmouseout="this.style.color=\'#333333\';" href="#" onclick="javascript:Toggle(2'+s1[0]+')">'+s1[1]+'</a><ul ></ul></li>');
table2 = true;
}
}else{
icheck = 0;
//alert(collection.length);
for(var y=0; y<collection.length;y++){
if(collection[y] == s1[0] && lv[y] == s1[3]){
icheck = 1;
//alert(collection[y]+' '+s1[0]);
}
}
if(icheck == 0){
collection[collection.length] = s1[0];
lv[lv.length] = s1[3];
if(s1[3] == 47){
$('td#td1').append('<li style="padding:0px;margin:0px;" id="1'+s1[0]+'" value="0" ><span id="p1'+s1[0]+'" class="ui-icon ui-icon-carat-1-e" value="0" ></span><a onmouseover="this.style.color=\'#EB8F00\';" onmouseout="this.style.color=\'#333333\';" href="#" onclick="javascript:Toggle(1'+s1[0]+')">'+s1[1]+'</a><ul></ul></li>');
table1 = true;
}else{
//alert(icheck);
$('td#td2').append('<li style="padding:0px;margin:0px;" id="2'+s1[0]+'" value="0" ><span id="p2'+s1[0]+'" class="ui-icon ui-icon-carat-1-e" value="0" ></span><a onmouseover="this.style.color=\'#EB8F00\';" onmouseout="this.style.color=\'#333333\';" href="#" onclick="javascript:Toggle(2'+s1[0]+')">'+s1[1]+'</a><ul></ul></li>');
table2 = true;
}
}
}
}
for(var a =0; a < d1.length; a++){
s1 = strSplit(d1[a],'|');
//string = s1.split(s1[1]);
z1 = strSplit(s1[2],"[Title]");
z2 = strSplit(z1[1],"#");
if(s1[3] == 47){
$('td#td1 li#1'+s1[0]+' ul').append('<li><a onmouseover="this.style.color=\'#EB8F00\';" onmouseout="this.style.color=\'#333333\';" href="http://dl.parliament.go.th/handle/lirt/'+z2[1]+'" target="_blank" title="'+z2[0]+'">'+z2[0].substring(0,30)+'...</a></li>');
}else{
$('td#td2 li#2'+s1[0]+' ul').append('<li><a onmouseover="this.style.color=\'#EB8F00\';" onmouseout="this.style.color=\'#333333\';" href="http://dl.parliament.go.th/handle/lirt/'+z2[1]+'" target="_blank" title="'+z2[0]+'">'+z2[0].substring(0,30)+'...</a></li>');
}
}
}
if(table1 == true){
$('#table1').show();
}
if(table2 == true){
$('#table2').show();
}
iframeResizePipe();
}
});
//$('li ul').hide();
});
function Toggle(id){
$('li#'+id+' ul').toggle();
if($('#p'+id).val() == 0){
$('#p'+id).attr("class","ui-icon ui-icon-triangle-1-se");
$('#p'+id).attr("value",1);
}else{
$('#p'+id).attr("class","ui-icon ui-icon-triangle-1-e");
$('#p'+id).attr("value",0);
}
iframeResizePipe();
return false;
}
function strSplit(str,charSplit){
var Str = new String(str);
var docId = Str.split(charSplit);
return docId;
}
function iframeResizePipe(){
//var height = gsadiv.scrollHeight;
var height = document.getElementById('gsadiv').scrollHeight;
var pipe = document.getElementById('helpframe');
pipe.src = 'http://dl.parliament.go.th/gsa/helper.html?height='+height+'&cacheb='+Math.random();
}
</script>
Tag : PHP, JavaScript, jQuery
|
|
|
|
|
|
Date :
2013-06-11 13:19:41 |
By :
yemenamen |
View :
1029 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เพราะ version ของ jquery ครับ
เพราะเวอร์ชัน 2.0 จะไม่รองรับ ie5,6,7 แล้วครับ
|
|
|
|
|
Date :
2013-06-11 15:38:29 |
By :
itpcc |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากครับ
ลืมบอกไป ผม test กับ ie8,ie9 อะครับ ....
|
|
|
|
|
Date :
2013-06-11 17:43:52 |
By :
yemenamen |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ปัญหาคือ คำสั่งไหนไม่ทำงานครับ กรุณาเจาะจงด้วยน่ะ
|
|
|
|
|
Date :
2013-06-11 18:42:33 |
By :
dekkuza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยอมรับว่า...
ผมก็ดูไม่ออก น่ะครับ ว่าคำสั่งไหนไม่ทำงานเพราะ browser อื่น ก็ run ได้ ปกติ.. แต่ใน ie8,9 มันไม่ขึ้นน่ะครับ
หรือว่า มี วิธี debug ของ ie แบบไหนรึป่่าว
|
|
|
|
|
Date :
2013-06-12 10:07:13 |
By :
yemenamen |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|