jQuery - data() == 'something' always return false
<p>I am trying to run a function depending on value of data attribute.
But it always return <code>false</code> when I run this:</p>

<pre><code>alert(jQuery(this).data('loaded') == 'no');
</code></pre>

<p>But my data attribute was set to no, and when I alert </p>

<pre><code>alert(jQuery(this).data('loaded'));
</code></pre>

<p>it return the correct data attribute value.</p>

<p><strong>Update</strong></p>

<p>HTML</p>

<pre><code>&lt;a class="btn" href="#" data-loaded="no"&gt;&lt;/a&gt;
</code></pre>

<p><strong>All of code</strong></p>

<pre><code>jQuery('a').click(function(e) {
    e.preventDefault();

    if (jQuery(this).data('loaded') == 'no'){
        ajax();
        jQuery(this).attr('data-loaded', 'yes');    
    }
});
</code></pre>
