Hello
Html Chunk:
<a class="class_link" href="">хатха-йога</a> A piece of js:
if ($('.class_link').text() == "хатха-йога"){ alert("good"); } Why does not display alert?
After the 9th comment: laid out the full script: http://jsfiddle.net/eCdLt/3/ if I zoomed out also in my own place - the condition does not work, turned off all the scripts except my own and jquery.
I do not get it
upd Found what's wrong. The problem with the encoding. In the case of English letters works. Thanks guys. Pause for now
upd Does not work on the live site console.log ("hatha yoga"); console.log ($ ('. class_link'). text ()); - in both cases "hatha yoga" is displayed. See website: yogaclass.pro
Script: http://yogaclass.pro/assets/templates/yogaclass/js/script.js
Strings
console.log($('.class_link').text()); console.log("хатха-йога"); if ($('.class_link').text() == "хатха-йога"){ alert("good in case of using jQuery"); } var a = "хатха-йога"; if (a == "хатха-йога"){ alert("good in case of using definite variable"); } UPD Corrected script encoding, as well as jQuery encoding. In the case of the introduction of the variable a, it works; if the text is taken by the script, it does not work.