Note that there are some explanatory texts on larger screens.

plurals
  1. POJava class gets loaded even if iframe is not called by clicking the link. Why?
    primarykey
    data
    text
    <p>I came across a strange problem . I have a jsp , which is calling an iframe . The iframe gets loaded with data from java.</p> <p>Now to render the iframe i am using customized <a href="http://code.google.com/p/infoscoop/source/browse/trunk/src/main/web/js/lib/control.modal.js?r=370" rel="nofollow">control-modal.js</a>.</p> <p>Now my iframe is coded after li tag like this :</p> <pre><code>&lt;li&gt; &lt;a id="modalLink" href="#myModal"&gt;Set up my Modal&lt;/a&gt; &lt;/li&gt; &lt;div id="myModal" &gt; &lt;div class="modalsubcol"&gt; &lt;p class="close"&gt;&lt;a href="#"&gt;&lt;img src="/.../close-button.gif" alt="Close"/&gt;&lt;/a&gt;&lt;/p&gt; &lt;iframe id="modal-frame"style="display:none;" height="430" width="675" src="&lt;%= getTheModal()%&gt;"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And i call the modal in the head part of my jsp like this :</p> <pre><code>&lt;script type="text/javascript"&gt; window.onload=function modalOverride(){ var myModal; $('modal-frame').style.display ='block'; myModal = new Control.Modal($('modalLink'), { afterOpen : function(){$$('.close a').invoke('observe','click',function(e){Control.Modal.close(); Event.stop(e);});}, opacity: 0.3, width: 675, fade: true, fadeDuration: 0.1, autoOpenIfLinked: false }); } &lt;/script&gt; </code></pre> <p>Now the link : <strong>Set up my Modal</strong> is part of a page containing many links. When i bring that page up, the java class that renders the data fro the modal also gets called. But this must happen only when , i click on the <strong>Set up my Modal</strong> link. </p> <p>Before some one tells me , this issue is not due to </p> <pre><code> window.onload </code></pre> <p>event, i have used it as otherwise the modal does not get loaded when i click the a fore mentioned link. I have tried by removing the <strong>window.onload</strong> event as well. If i do that, the java class still gets loaded and now my iframe does not get loaded . No errors come up in fire bug as well.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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