简体   繁体   中英

Firebug changes the Javascript environment of Firefox 3.6

I was doing some debugging of a site in Firefox 3.6.21 using Firebug 1.7.3. When the page first loads, the Javascript I am trying to execute doesn't load at all. I open up Firebug to see what the problem is, I hit reload, and all of a sudden it's working.

I have no idea what is going on here.

function initStations() {
  //console.log("in stations")
  ringContainer = $("#ringContainer");
  ringWidth = ringHeight = ringContainer.innerWidth();
  //console.log(ringWidth + " " + ringHeight);
  originX = (ringWidth / 2) - 0;
  originY = (ringHeight / 2);
  radius = originY + 20;
  //console.log(originX + " " + originY + " " + radius);
  // get the ul containing the stations
  stationList = $("#stationList");
  // an array of the li elements
  stationLiElems = $("#stationList li");
  // how many stations
  length = stationLiElems.size();
  // distance between stations in degrees
  spacing = (360 / length)
  // 360 degrees in circle divided by the number of stations
  // array of stations
  stations = [];
  // debug
  //console.log(stationList);
  stationLiElems.each(function(index, element) {
  //console.log(index +" - "+ spacing);
  stations[index] = {
    'element' : element,
    // http://stackoverflow.com/questions/925118/algorithm-for-finding-out-pixel-coordinates-on-a-circumference-of-a-circle
    'x' : originX + radius * Math.sin(spacing * index * 0.0174532925 ),
    'y' : originY + radius * Math.cos(spacing * index * 0.0174532925 )
  }
  $(element).css({'top' : stations[index].y , 'left' : stations[index].x });
});

Had this same issue, and removing console.log fixed it for me. I see you have commented it out, but check you aren't using it elsewhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM