English 中文(简体)
javascript isn t working in IE Unless debugger is的
原标题:javascript isn t working in IE unless debugger is running

下列法典在Fox 7号公司完全运作,但在IE 9号公司开出同一页时,j Query(ide和显示)没有工作。 然而,如果你在互联网上开脱,复读,所有东西都会奏效。 如同“ j鱼”法一样,除非 de弄,否则会打赢工作,而且你会重新翻一页(或用 de子开一页),这显然使得难以解冻。

all the CSS and scripting are included for this sample. If I need to include any other information please let me know.

<!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>
<!--<link href="_css/main.css" rel="stylesheet" type="text/css" />-->


 <style>    

html, body {
    margin: 0px;
    padding: 0px;
}

#wrapper {
    width:1000px;
    margin-left: auto;
    margin-right: auto;
    height: 100%;
}
#sidebar {
    width: 100px;
    height:100%;
    float: left;
    background-color: #FF0;
}

#maincontent {
    float: left;
    width: 400px;
    height:100%;
    ;
    background: #c1d8b9;
}
#right {
    width: 500px;
    background-color: #0F3;
    float: right;
    height: 100%;
}



body {
    background-color: white;
}


ul
{
    list-style-type: none;
}
</style> 
 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>



<body>
<div id="wrapper">
  <div id="sidebar"> Sidebar
    <ul >
    </ul>
  </div>
  <div id="maincontent"> Main content
      <button id="hidr">Hide</button>
  <button id="showr">Show</button>
    <ul id="listMiddle">
      <li id="li1">TEST1</li>
      <li id="li2">TEST2</li>
      <li id="li3">TEST3</li>
      <li id="li4">TEST4</li>
    </ul>
  </div>
  <div id="right"> Right
    <ul id="listRight">
    </ul>
  </div>
</div>

<script>    
var arryLIs = document.getElementsByTagName( li );
var middleUL = document.getElementById( listMiddle );
var rightUL = document.getElementById( listRight );
var arrymiddleLIs = middleUL.getElementsByTagName( li );
var arryrightLIs = rightUL.getElementsByTagName( li );


for (var i=0; i<arryLIs.length; i++){
    arryLIs[i].onclick = moveright; 
    //console.log(arryLIs[i].innerHTML);

}


console.log(arrymiddleLIs);
console.log(middleUL);

var goBefore=null;

function moveright() {
    var goBefore=null;
    goBefore=findSortRight(this);
    document.getElementById( listRight ).insertBefore(this,goBefore);
    this.onclick = moveleft;
    //console.log(arrymiddleLIs);
    //console.log(arryrightLIs);

}

function moveleft() {
    document.getElementById( listMiddle ).appendChild(this);
    this.onclick = moveright;   
    console.log(arrymiddleLIs);
    console.log(arryrightLIs);  
}

function findSortRight(newElement){
    var goBefore=null;
    for (var r=0; r<arryrightLIs.length; r++){
        //console.log(newElement.innerHTML<=arryrightLIs[r].innerHTML);
        if (newElement.innerHTML<=arryrightLIs[r].innerHTML) {
            //console.log(arryrightLIs[r]);
            goBefore=arryrightLIs[r];
            break;
        }
    }
//  console.log(goBefore.innerHTML);
    return goBefore;

}



    $("#hidr").click(function () {
      $("li").hide();
    });

    $("#showr").click(function () {
      $("li").show();
    });


</script> 

</body>
</html>
最佳回答

<代码>console.log是一个问题。 在下列情况发生缺席时,撤销或将其界定为:

console = console || {};
console.log = console.log || function(){};
问题回答

你的问题似乎来自ole木活动。 基本上,独立实体不知道与他们做些什么,在它收到之前就坠毁了联合材料。

你们可以做这样的事情:

if( window.console != undefined) {
    //your console logs goe here
}

这些解决办法都没有为我服务。 这里我发现的是:

if (typeof(console) ===  undefined ) {
    console = { log : function(){ /*alert(arguments[0]);*/ } };
}

如果实际定义,你就希望奥人能够工作。

为此:

    if (typeof console !==  undefined ) {
        console = {};
        console.log = function() {};
    }




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签