Bootstrap modal data-remote does not work in Chrome

I have a bootable modal data-remote that works for all browsers except Chrome. The background shows, but not the modal itself.

parentPage.html

<a href="#" data-toggle="modal" data-target="#myModal"><img src="images/ball.gif" alt="Add Account"/></a>
<div class="modal fade" id="myModal" tabindex="-1" data-remote="./popups/remotePage.html" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false" >
</div>

remotePage.html

<div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        Header
      </div>
      <div class="modal-body">
            One fine body...
      </div>
      <div class="modal-footer">Footer
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->

I have already tried putting data-remote in a tag <a>.

What am I missing?

+4
source share
1 answer

Use this code. Assuming you are using Twitter Bootstrap 3.

parentPage.html

<a href="./popups/remotePage.html" data-toggle="modal" data-target="#myModal"><img src="images/ball.gif" alt="Add Account"/></a>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false" >
<div class="modal-dialog">
    <div class="modal-content">
    </div>
</div>
</div>

remotePage.html

<div class="modal-header">Header</div>
<div class="modal-body">
    One fine body...
</div>
<div class="modal-footer">Footer</div>

And don't forget that the directory structure looks something like this:

parentPage.html
popups
   remotePage.html

Update

Google Chrome XMLHttpRequest (file://) . .

, HTTP-. Windows, WAMP XAMPP.

- - Chrome,

chrome.exe --disable-web-security

: Google Chrome XMLHttpRequest URL-

+8

Source: https://habr.com/ru/post/1526991/


All Articles