Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery load if iframe doesn't exist
    primarykey
    data
    text
    <p>Once i have clicked once on both items of the li(Google &amp; Bing) i have created the iframes and i can do a search.</p> <p>Now how would i do when i click again on the li to check if the iframe is already there so i don't reload the search? Does that make sense? </p> <pre><code>&lt;HTML&gt; &lt;HEAD&gt; &lt;TITLE&gt;&lt;/TITLE&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js "&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js "&gt;&lt;/script&gt; &lt;style type="text/css"&gt; iframe {width: 100%;height: 100%;max-width: 850px;min-height: 890px;overflow-x: hidden;overflow-y: auto;} &lt;/style&gt; &lt;/HEAD&gt; &lt;body&gt; &lt;div id="search_engines" class="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#google" onclick="googleLoad();"&gt;Google&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#bing" onclick="bingLoad();"&gt;Bing&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="google"&gt; &lt;a href="javascript: void(0)" onclick="googleLoad();" style="text-decoration: none" class=""&gt;New search&lt;/a&gt; &lt;script type="text/javascript"&gt; function googleLoad() { $("#googleIframe").html('&lt;iframe id="googleLoad" frameborder="0" src="http:www.google.com"&gt;&lt;/iframe&gt;'); } &lt;/script&gt; &lt;div id="googleIframe"&gt; &lt;!--Iframe goes here --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="bing"&gt; &lt;a href="javascript: void(0)" onclick="bingLoad();" style="text-decoration: none" class=""&gt;New search&lt;/a&gt; &lt;script type="text/javascript"&gt; function bingLoad() { $("#bingIframe").html('&lt;iframe id="bingLoad" frameborder="0" src="http:www.bing.com"&gt;&lt;/iframe&gt;'); } &lt;/script&gt; &lt;div id="bingIframe"&gt; &lt;!--Iframe goes here --&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/HTML&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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