Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Bootstrap remote Modal fix
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Markshall" data-source="post: 218970" data-attributes="member: 1872"><p>If you're an avid Bootstrap user like myself, you've more than likely used the Modal plugin. You may also have noticed there's a feature in there where you can load content from a remote file. The only problem with it is, is that when you open the modal, the content loads -- which is fine -- but, if you close the Modal, change the content of the external file and then reopen the Modal, the content doesn't refresh.</p><p> </p><p>Well, I've coded a little fix that may help you if you have the same problem as me.</p><p> </p><p>[CODE]$("[data-toggle='modal']").click(function(e){</p><p> e.preventDefault();</p><p> </p><p> $($(this).attr("data-target") + ' .modal-body').load($(this).attr("href"), function(){</p><p> $($(this).attr("data-target")).modal('show');</p><p> });</p><p>});[/CODE]</p><p> </p><p>Hope it helps.</p><p>Mark</p></blockquote><p></p>
[QUOTE="Markshall, post: 218970, member: 1872"] If you're an avid Bootstrap user like myself, you've more than likely used the Modal plugin. You may also have noticed there's a feature in there where you can load content from a remote file. The only problem with it is, is that when you open the modal, the content loads -- which is fine -- but, if you close the Modal, change the content of the external file and then reopen the Modal, the content doesn't refresh. Well, I've coded a little fix that may help you if you have the same problem as me. [CODE]$("[data-toggle='modal']").click(function(e){ e.preventDefault(); $($(this).attr("data-target") + ' .modal-body').load($(this).attr("href"), function(){ $($(this).attr("data-target")).modal('show'); }); });[/CODE] Hope it helps. Mark [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Bootstrap remote Modal fix
Top