Incompatibility of Chrome and Firefox

I have two frames, an expression running in the first frame, and a call to the highlightElements function in another frame. This expression works fine in Firefox:

parent.frames[0].highlightElements(lineNumbers, stringObj);

Function highlightElements (exactly):

function highlightElements(lineNumbers, stringObj) {
  // run through the cycle and highlight them
  //for (var ln in lineNumbers) {
  var length = lineNumbers.length;
  for (var ln=0; ln<length; ln++) {
    var elements = $('.no');
    //for (var i in elements) {
    var el_length = elements.length;
    for (var i=0; i<el_length; i++) {
      if (parseInt(elements[i].innerHTML) == lineNumbers[ln]) {
        var badThing = "yes";
        for (var nextElement = elements[i].next();
             nextElement.className != '.no'; nextElement = elements[i].next()) {
          if (nextElement.innerHTML == stringObj) {
            badThing = "no";
            nextElement.effect('highlight', {}, 'slow');
            scrollIntoView(nextElement);
          }
        }
        if (badThing == "yes") alert("Didn't find the object");
      }
    }
  }
}

But in Chrome, the error "Uncaught TypeError: property" highlightElement "of the object [objectDOMWindow] is not a function."

How to change an expression so that it runs in Chrome? Thanks

+3
source share
1 answer

, . Chome javascript , / . , (.. URL- - :///C:/etc/etc.html), .

+1

All Articles