javascript - Cannot read property 'childNodes' of undefined error but only in chrome -
i'm using knockout.js create drag/drop diary customer, , i've switched testing in chrome mysterious error "cannot read property 'childnodes' of undefined"
in parsebindingstring
function of knockout template tested , working in firefox/ife10.
the error thrown on css: { blackout: workinghours($parent.daysarray(0), $parents[1].viewdate()).starttime.gettime() == workinghours($parent.daysarray(0), $parents[1].viewdate()).finishtime.gettime() }
binding, in debugger context node
local variable has 4 registered child nodes expected knockout must trying serious tree navigation here, isn't necessary workinghours()
function or add blackout
class current node.
i presume has arisen in chrome due minor differences in way dom constructed between browsers, offer advice on how can resolve kind of issue? or things check?
<td data-bind=" css: { blackout: workinghours($parent.daysarray(0), $parents[1].viewdate()).starttime.gettime() == workinghours($parent.daysarray(0), $parents[1].viewdate()).finishtime.gettime() }"> <div class="unallocated-booking"> <div class="status-bar-holder mini-status-bar-holder" data-bind=" template: { name: 'unallocated-booking-template', foreach: todaysbookings($parent.daysarray(0), bookings, $parents[1].viewdate()) }"/> </div> <div data-bind=" attr: { 'data-init-droppable': false }, class: { droppable: isworkday( $parent.daysarray(0), $parents[1].viewdate() ) }, template: { name: 'week-cell-template', foreach: todaysbookings($parent.daysarray(0), bookings, $parents[1].viewdate()) }"/> </td>
minor aside (probably needing separate question) ironically tried loading in chrome because attr
/class
/template
binding on last element seems ignoring class
& attr
bindings since added template
binding , wanted debug in chrome. since i've got attention of knockout.js aficionado's thought i'd plug in here :p. might relevant though can't see issue syntax.
knockout.js wasn't cause of issue
turned out difference in way getelementsbytagname()
works in chrome doesn't require (or work when) namespace of searched element specified.
Comments
Post a Comment