-1

My question is similar too, if not the exact same as This one about modals. The problem seems to be, that my .txt file wont load into the modal body:

<p><a data-toggle="modal" href="http://adambalan.com/aisis/aisis_version_notes.txt" data-target="#modal" class="updateNotes">READ MORE ABOUT IT!</a></p>

    <div class="modal hide fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <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">
  </div>
</div>  

<script>
$(document).ready(function(){  
    $('a.updateNotes').on('click', function(e) {
        e.preventDefault();
        var url = $(this).attr('href');
        $('.modal-body').html(url);
    });​    
});
</script>   

any ideas?

Community
  • 1
  • 1
TheWebs
  • 12,470
  • 30
  • 107
  • 211

1 Answers1

0

If you are not trying to get cross-domain content, I think you code is correct. Since you are using data-api syntax, actually you don't need to write any JS to bring the content from the link. Bootstrap modal javascript would do it for you. Are you including the 'bootstrap.js' file ?

tharumax
  • 1,251
  • 9
  • 15