jQuery.get() Help
<p>What's wrong with this function:</p>

<pre><code>function() {
    $.get('/controller/action', function(data) {
        $('#temporaryPhotos').text(data);
    } );
    return false;
}
</code></pre>

<p>What it should do is fetch HTML from <em>/controller/action</em> page and insert the HTML into the #temporaryPhotos div on the current page.</p>

<p>Initial markup looks like this:</p>

<pre><code>&lt;div id="temporaryPhotos"&gt;&lt;/div&gt;
</code></pre>

<p>So it's just an empty div. The jQuery function should fill it with photos form another page (it's the same website, of course). But the div stays empty.</p>

<p>EDIT:</p>

<p>I think I have not been very clear with my post so here is an additional information. What I am actually trying to accomplish is to use the abovementioned function as a callback for the Uploadify jquery plugin (<a href="http://www.uploadify.com" rel="nofollow">http://www.uploadify.com</a>).</p>

<p>Here is the full javascript code:</p>

<pre><code>$(document).ready(function() {    
    $('#photo').uploadify({
        'uploader'       : '/flash-uploader/scripts/uploadify.swf',
        'script'         : '/flash-uploader/scripts/upload-public-photo.php',
        'cancelImg'      : '/flash-uploader/cancel.png',
        'scriptData'     : {'user_id' : 'USER_ID'},
        'queueID'        : 'fileQueue',
        'auto'           : true,
        'multi'          : true,
        'sizeLimit'      : 2097152,
        'fileExt'        : '*.jpg;*.jpeg;*.gif;*.png',
        'wmode'          : 'transparent',
        'onComplete'     : function() {
            $.get('/controller/action', function(data) {
                alert(data);
                $('#temporaryPhotos').html(data);
            } );
            return true;
        }
    });
});
</code></pre>

<p>I have tried both text() and html(), also alert(). Still nothing :(</p>

<p>EDIT2:</p>

<p>Upon further research I have found out that a default onComplete() function in the Uploadify plugin looks like this:</p>

<pre><code>jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {
    if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {
        jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');
        jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});
    }
});
</code></pre>

<p>I have rewritten this function with my own (first one in this post) and that appears to be a problem.</p>

<p>EDIT3:</p>

<p>Head section of the page:</p>

<pre><code>&lt;script type="text/javascript" src="/js/jquery-1.3.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/flash-uploader/scripts/swfobject.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="/flash-uploader/scripts/jquery.uploadify.v2.1.0.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    //&lt;![CDATA[
$(document).ready(function() {    
    $('#photo').uploadify({
        'uploader'       : '/flash-uploader/scripts/uploadify.swf',
        'script'         : '/flash-uploader/scripts/upload-public-photo.php',
        'cancelImg'      : '/flash-uploader/cancel.png',
        'scriptData'     : {'user_id' : 1},
        'queueID'        : 'fileQueue',
        'auto'           : true,
        'multi'          : true,
        'sizeLimit'      : 2097152,
        'fileExt'        : '*.jpg;*.jpeg;*.gif;*.png',
        'wmode'          : 'transparent',
        'onComplete'     : function() {
            alert("hello");
        }
    });
});    //]]&gt;
&lt;/script&gt;&lt;script type="text/javascript" src="/js/document-ready.js"&gt;&lt;/script&gt;
</code></pre>
