-3

I have problem with condition of Germany charset:

if (jQuery(this).find("dt").text()=="Kälteleistung")

Its always return false but in jQuery(this).find("dt").text() alert print Kälteleistung

Popnoodles
  • 28,090
  • 2
  • 45
  • 53
Arthur Yakovlev
  • 8,933
  • 8
  • 32
  • 48

2 Answers2

0
if(jQuery(this).find("dt").text()==jQuery("<div/>").html("K&auml;lteleistung").t‌​ext())

This simple solution help me. There are we are find special char of ä char. We are formed string for condition "K&auml;lteleistung" and our task is return string which be same as we take in our html. We are need place it to html jQuery("<div/>").html("K&auml;lteleistung") and take it .t‌​ext(). Very simple and clear solution which does not require a third-party libraries.

Thanks!

Arthur Yakovlev
  • 8,933
  • 8
  • 32
  • 48
0

I got your question working, without the need of extra stuff. I think your problem is in the selector not working good (there is no need to use find).

I have this sample, returning 'ok':

<div>Kälteleistung</div>

<script>
    if ($("div").text()=="Kälteleistung")
    {
        alert('ok');
    }
    else
    {
        alert('not ok');
    }
</script>
Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325