1

I'm trying to load the content of internal url into the bootstrap modal when the user clicks the button. However, when I click the button I get the error mentioned on the title of question.

Here is my code :

<template name="flowchart">
    <div class='container-fluid'>
        {{#if currentUser}}
        <div class="row-fluid">
            <div class="span8">
                <h3>Flowchart Editor</h3>
                <div id="flowchart">
                    <a href="#myModal" role="button" class="btn" data-toggle="modal" data-remote="http://localhost:3000/">Launch demo modal</a>
                    <!-- <button type="button" class="btn" data-toggle="modal" data-target="#myModal" data-remote="http://localhost:3000/">Launch modal</button> -->
                </div>

            </div>
            <div class="span4">
            </div>
            <button type="button" class="btn" data-toggle="modal" data-target="#myModal" data-remote="http://example.com">Launch modal</button>

            <div id="myModal" class="modal hide fade">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button>
                    <h3 id="myModalLabel">Modal header</h3>
                </div>
                <div class="modal-body">
                    <!-- remote content will be inserted here via jQuery load() -->
                </div>
                <div class="modal-footer">

                </div>
            </div>



        </div>
        {{else}}
        <div class="row-fluid" style="text-align:center;margin-top: 80px;">
            <h3>The flowchart is only available to logged in users.</h3>
            <p class="lead">If you just want to try out the flowchart, you can use the Demo Account:</p>
            <p class="lead">User: demo, Password: demo</p>
        </div>
        {{/if}}
    </div>

</template>

As a result, I'm unable to show the content of internal url, what should I do in order to fix this problem?

Edit

When I remove the data-remote attribute from the button, everything works fine but that is not what I want to do it. By the way, I'm using bootstrap 2.3.2 and jquery 1.8.2

zwlayer
  • 1,752
  • 1
  • 18
  • 41
  • 1
    could you replicate the same on jsfiddle,http://jsfiddle.net – dreamweiver Sep 21 '15 at 11:34
  • @dreamweiver I'm afraid I'm not because, I think modal does not allow CROSS request. How could I give an internal uri in jsfiddle? – zwlayer Sep 21 '15 at 11:35
  • Can you give js code then? So we can see how you are inserting it. Maybe sth like this will come handy http://stackoverflow.com/questions/22418592/bootboxjs-how-to-render-a-meteor-template-as-dialog-body – sdooo Sep 21 '15 at 14:11
  • @Sindis In js part, there is nothing related with modal. All I do is in this for modal – zwlayer Sep 21 '15 at 14:51

0 Answers0