Google doesn`t execute my JS code. In Firefox everything works fine
$('a[href="#pricends"]').click(function(){
$("div.text_1").text(($("div.text_1").text() == 'smth1') ? 'smth2' : 'smth1')
$("div.text_2").text(($("div.text_2").text() == 'smth2') ? 'smth1' : 'smth2')
if ( $('div.text_1').text().contains("smth1") ) {
//smth here
}
Chrome console output points to "if" line above.
Uncaught TypeError: undefined is not a function (anonymous function) f.event.dispatch jquery-1.7.2.min.js:3 h.handle.i
How to fix this? Nothing goes at mind now, name function and compare it with bool before if ?
.contains()method, though it's coming in ECMAScript 6 and currently available in Firefox. Chrome has it flagged as an experimental feature.