English 中文(简体)
javascript - Failed toload sources for: http:// localhost/js/m.js
原标题:javascript - Failed to load source for: http://localhost/js/m.js

为什么会说...... 我可以指出,我为什么继续犯这一错误。 我认为我可能会 cr。

/*** common functions  */
function GE(id) { return document.getElementById(id); }

function changePage(newLoc) {
   nextPage = newLoc.options[newLoc.selectedIndex].value

   if (nextPage != "")
   {
      document.location.href = nextPage
   }
 }

function isHorizO(){
  if (navigator.userAgent.indexOf( iPod )>-1)
    return (window.orientation == 90 || window.orientation==-90)? 1 : 0;
   else   return 1;

}

function ShowHideE(el, act){
    if (GE(el)) GE(el).style.display = act;
}

function KeepTop(){
    window.scrollTo(0, 1);
}

/* end of common function */

var f = window.onload; 
if (typeof f ==  function ){
    window.onload = function() {
        f();
        init();
    }
}else window.onload = init;

function init(){
    if (GE( frontpage )) init_FP();
    else {
        if (GE( image )) init_Image();
        setTimeout( window.scrollTo(0, 1) , 100); 
     }

    AddExtLink();
}

function AddExtLink(){
    var z = GE( extLink );
    if (z){
        z = z.getElementsByTagName( a );
        if (z.length>0){
            z = z[0];
            var e_name = z.innerHTML;
            var e_link = z.href;

            var newOption, oSe;
            if (GE( PSel )) oSe = new Array(GE( PSel ));
            else
                oSe = getObjectsByClassName( PSel ,  select )

            for(i=0; i<oSe.length; i++){
                newOption = new Option(e_name, e_link);
                oSe[i].options[oSe[i].options.length] = newOption;
            }
        }
    }
}

/* fp */
function FP_OrientChanged() {
    init_FP();
}

function init_FP() {
  //  GE( orientMsg ).style.visibility = (!isHorizO())?  visible  :  hidden ;
}

/* gallery */
function GAL_OrientChanged(link){
    if (!isHorizO()){
        ShowHideE( vertCover ,  block );
        GoG(link);
    }
    setTimeout( window.scrollTo(0, 1) , 500);
}
function init_Portfolio() {
 //   if (!isHorizO())
 //       ShowHideE( vertCover ,  block );
}
function ShowPortfolios(){
    if (isHorizO()) ShowHideE( vertCover ,  none );
}

var CurPos_G = 1
function MoveG(dir) {
    MoveItem( G ,CurPos_G, dir);
}

/* image */
function init_Image(){
    // check for alone vertical images
    PlaceAloneVertImages();
}
function Img_OrtChanged(){
    //CompareOrientation(arImgOrt[CurPos_I]);
    //setTimeout( window.scrollTo(0, 1) , 500);
}

var CurPos_I = 1
function MoveI(dir) {
    CompareOrientation(arImgOrt[CurPos_I+dir]);
    MoveItem( I ,CurPos_I, dir);
}

var arImgOrt = new Array(); // orientation: 1-horizontal, 0-vertical
var aModeName = new Array( Horizontal  ,  Vertical );
var arHs = new Array();

function getDims(obj, ind){
    var arT = new Array(2);

    arT[0] = obj.height; 
    arT[1] = obj.width;


     //arWs[ind-1] = arT;
    arHs[ind] = arT[0];

     //**** (arT[0] > arT[1]) = (vertical image=0)
     arImgOrt[ind] = (arT[0] > arT[1])? 0 : 1;

    // todor debug
    if(DebugMode) {
        //alert("["+obj.width+","+obj.height+"] mode="+((arT[0] > arT[1])?  verical  :  hoziontal ))
        writeLog("["+obj.width+","+obj.height+"] mode="+((arT[0] > arT[1])?  verical  :  hoziontal )+  src= +obj.src)
    }        
     if (arImgOrt[ind]) {
        GE( mi +ind).className =  mImageH ;
     }

}
function CompareOrientation(imgOrt){
    var iPhoneOrt = aModeName[isHorizO()];
    GE( omode ).innerHTML = iPhoneOrt;
    //alert(imgOrt == isHorizO())
    var sSH = (imgOrt == isHorizO())?  none  :  block ;
    ShowHideE( vertCover , sSH); 

    var sL = imgOrt?  H  :  V ;
    if (GE( navig )) GE( navig ).className =  navig + sL ;
    if (GE( mainimage )) GE( mainimage ).className =  mainimage +sL;
    var sPfL = imgOrt?  Port-<br>folios  :  Portfolios  ;
    if (GE( PortLnk )) GE( PortLnk ).innerHTML = sPfL;

}

function SetGetDim( iMInd){
    var dv = GE( IImg +iMInd);

    if (dv)   {
        var arI = dv.getElementsByTagName( img );
        if (arI.length>0){
            var oImg =  arI[0];
            oImg.id =  Img +iMInd;
            oImg.className =  imageStyle ;
             //YAHOO.util.Event.removeListener( Img +iMInd, load );
             YAHOO.util.Event.on( Img +iMInd,  load , function(){GetDims(oImg,iMInd);}, true, true);
           //oImg.addEventListener( load ,GetDims(oImg,iMInd),true);
        }
    }
}
var occ = new Array();
function PlaceAloneVertImages(){
    var iBLim, iELim;
    iBLim = 0;
    iELim = arImgOrt.length;
    occ[0] = true;
    //occ[iELim]=true;

    for (i=1; i<iELim; i++){
        if ( arImgOrt[i]){//horizontal image
            occ[i]=true;
            continue;
        }else { // current is vertical
            if (!occ[i-1]){//previous is free-alone. this happens only the first time width i=1
                occ[i] = true;
                continue;
            }else {
                if (i+1 == iELim){//this is the last image, it is alone and vertical
                    GE( mi +i).className =  mImageV_a ; //***** expand the image container
                }else {
                    if ( arImgOrt[i+1] ){
                        GE( mi +i).className =  mImageV_a ;//*****expland image container
                        occ[i] = true;
                        occ[i+1] = true;
                        i++;
                        continue;
                    }else { // second vertical image
                        occ[i] = true;
                        occ[i+1] = true;
                        if (arHs[i]>arHs[i+1]) GE( mi +(i+1)).style.height =  arHs[i]+ px ;
                        i++;
                        continue;
                    }
                }
            }

        }


    }
    //arImgOrt

}

function AdjustWebSiteTitle(){

    //if (GE( wstitle )) if (GE( wstitle ).offsetWidth > GE( wsholder ).offsetWidth) {
    if (GE( wstitle )) if (GE( wstitle ).offsetWidth > 325) {
        ShowHideE( dots1 , block );
        ShowHideE( dots2 , block );
    }
}

function getObjectsByClassName(className, eLTag, parent){
    var oParent;
    var arr = new Array();
    if (parent) oParent = GE(parent); else oParent=document;
    var elems = oParent.getElementsByTagName(eLTag);
    for(var i = 0; i < elems.length; i++)
    {
        var elem = elems[i];
        var cls = elem.className
        if(cls == className){
            arr[arr.length] = elem;
        }
    }
    return arr;
}



////////////////////////////////
///
// todor debug 
var DebugMode = (getQueryVariable("debug")=="1")
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  var sRet = ""
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
        sRet = pair[1];
    }
  }
  return sRet
  //alert( Query Variable   + variable +   not found );
} 
var oLogDiv=  
function writeLog(sMes){
    if(!oLogDiv) oLogDiv=document.getElementById( oLogDiv )
    if(!oLogDiv) {
        oLogDiv = document.createElement("div");
        oLogDiv.style.border="1px solid red"
        var o = document.getElementsByTagName("body")
        if(o.length>0) {
            o[0].appendChild(oLogDiv)
        }
    }        
    if(oLogDiv) {
        oLogDiv.innerHTML = sMes+"<br>"+oLogDiv.innerHTML
    }
}
最佳回答

首先,大火是你的朋友,被利用。 第二,如果你履行每项职能和一些辅助职能,一个职能,你最终将达到以下目标。

var DebugMode = (getQueryVariable("debug")=="1")
function getQueryVariable(variable)

You execute 在定义之前,你可以创建一种处理未来参考的渠道,尽管存在差别。

你们的法典中还有其他几个潜在问题,但是,在“贱民”方法接近之后,将“瓦尔德贝杜姆德”线放开,应当进行罚款。

问题回答

如果你给予更多的帮助,它将有所帮助。 例如:

Failed to load source for: http://localhost/js/m.js

错误信息的字句? 什么地方和什么时候?

此外,该守则是否代表<代码>http:// localhost/js/m.js的内容? 似乎这样,但很难说。

无论如何,你所显示的Java语中,有相当多的说法没有他们的半殖民地。 也可能出现其他同学错误。 如果你能够自行找到这些工具,你可能会找到诸如jslint 等工具。

确保标签上的特性是“文字/文字”而不是“文字/文字”。

我知道这个问题已经问了一年多,但今天我面临这个问题。 我

<script type="text/javascript" src="/test/test-script.js"/>

并且我正在接手以下装货源:http:// localhost/test/test-script.js” rel=“nofollow”>。 http:// localhost/test/test-script.js 火灾错误。 甚至还未装上这种文字。 随后,我修改了上述行文如下:

<script type="text/javascript" src="/test/test-script.js"></script>

它开始在Empa和Chrome工作。 在这里记载这一点,希望这将有助于某人。 Btw, I dont知道,为什么后来的工程与以前的工程一样。





相关问题
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.

热门标签