Jquery get image
<p>I am using a form to submit details to a page which create an image, the form is submitted using Jquery so that the user does not have to leave the page. The send() function calls on the refresh() function to update the div where the image is placed into...</p>

<p>I am having an issue with one of the lines of code of my code and I don't know what to put to get it to work:</p>

<pre><code>    function refresh()
{
    $(function () {
        var img = new Image();
        $(img).load(function () {
            //$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
            $(this).hide();
            $('#loader').removeClass('loading').append(this);
            $(this).fadeIn();
        }).error(function () {
            // notify the user that the image could not be loaded
// The next line causes the error
       }).attr('src', "signatures/" +$("#username") "png");
    }); 

}
</code></pre>

<p>Any help would be appreciated.</p>
