Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your <code>load_bk_photo</code> function has some issues (missing semi-colons, creating global variables), try changing to this:</p> <pre><code>function load_bk_photo(){ //we can use the `var` keyword once and separate each variable declaration by a comma, then finish all the declarations with a semi-colon var activeId = '&lt;%=(activeTempStoreId)%&gt;', redStr_id = "side1", d = new Date(), time_temp = d.getTime(), photoUrl = "photos/merged_" + activeId + "_" + redStr_id+".png?" + time_temp; alert ("timebbb = " + time_temp ); //you can use one `.css()` function call to do both operations $('#resizable-img').css({ 'background-image' : 'url("' + photoUrl + '")', display : 'block' }); } </code></pre> <p>You were creating global variables which is only necessary if you are changing the value of variables outside the scope of this function.</p> <p>Onto your main question, you can set a <code>load</code> event handler for the <code>&lt;iframe&gt;</code> element as a callback function on your upload:</p> <pre><code>$('#MyFrame').on('load', function () { //The iframe has loaded and you can do what you want, including get the contents of the iframe (server-response) var response = $(this).contents().find('body').text(); }); </code></pre> <p>Make sure to set this binding before the source of the <code>&lt;iframe&gt;</code> is changed.</p> <p>Note that <code>.on()</code> is new in jQuery 1.7 and in this case is the same as <code>.bind()</code>.</p> <p><code>.on()</code>: <a href="http://api.jquery.com/on" rel="nofollow">http://api.jquery.com/on</a></p> <p><strong>UPDATE</strong></p> <p>I don't know asp classic but if you output something like <code>storeWidth|storeHeight</code> in your asp code then you can get that response in you JavaScript and do what you want with it:</p> <pre><code>$('#MyFrame').on('load', function () { //The iframe has loaded and you can do what you want, including get the contents of the iframe (server-response) var response = $(this).contents().find('body').text().split('|'); alert(response[0] + 'x' + response[1] + 'px'); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload