Note that there are some explanatory texts on larger screens.

plurals
  1. POReload modal-content inside modal on click
    primarykey
    data
    text
    <p>I have this very simple jQuery-script to change modal content based on link. Code:</p> <pre><code>$('#facebook-friends').on('hidden', function () { $(this).removeData('modal'); }); </code></pre> <p>And then I can control which content will be used, based on the buttons:</p> <pre><code>&lt;a href="facebook-frame.php" id="full-width" data-target="#facebook-friends" role="button" class="btn btn-primary" data-toggle="modal"&gt;&lt;i class="icon-facebook"&gt;&lt;/i&gt; Use Facebook&lt;/a&gt; </code></pre> <p>It works perfectly! However, I have links inside this <code>facebook-frame.php</code> file, and I want all actions to stay within the modal, so that the outside page doesn't reload.</p> <p>I have tried this solution inside <code>facebook-frame.php</code> but it doesn't work.</p> <pre><code>&lt;a href="facebook-frame.php?all" data-target="#facebook-friends" role="button" class="btn btn-primary" data-toggle="modal"&gt; </code></pre> <p>This is the modal on my mainpage:</p> <pre><code> &lt;div class="modal fade hide" id="facebook-friends" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" &gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt; &lt;h3 id="myModalLabel"&gt;Inviter veninder fra Facebook&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body text-center"&gt; &lt;p&gt;Loading content...&lt;/p&gt; &lt;p&gt;&lt;IMG src="ajax-loader.gif"&gt;&lt;/p&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn" data-dismiss="modal" aria-hidden="true"&gt;Luk&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I especially love the "Loading content", as it seems very dynamic.</p> <p>Is there any way to assign a special command/class/name to links/buttons inside <code>facebook-frame.php</code> so that when clicked it will temporary show the "Loading content" and then meanwhile load the requested page (inside <code>href</code> attribute)?</p>
    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