If in jquery does not work
<p>I wrote this script, but it doesn't work in way I wanted:</p>

<pre><code>$(document).ready(function(){
    if ($('#map_container').find('#point').length == 0 ) {
        $("#map_container").click(function (e) { 
            var relativeXPosition = (e.pageX - this.offsetLeft);
            var relativeYPosition = (e.pageY - this.offsetTop);
            //alert('left: '+relativeXPosition+', top: '+relativeYPosition);
            $("#map_container").append('&lt;img id="point" src="&lt;?=url::base();?&gt;images/city.png" alt="" /&gt;');
            $("#point").css({ top: (relativeYPosition) + 'px', left: relativeXPosition + 'px', position: 'absolute' })
        }); 
    }
});
</code></pre>

<p>It should put only one img with id="point", but when I click map_container two times I get two img's, why this if does not work?</p>
