I have an issue with a piece of script I am running which is suppose to populate this modal:
<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">Latest Updates!</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
The code is:
(function($){
$(document).ready(function(){
$('a.updateNotes').on('click', function(e) {
e.preventDefault();
var url = $(this).attr('href');
$(".modal-body").html('<iframe width="100%" height="100%" frameborder="0" scrolling="yes" allowtransparency="true" src="'+url+'"></iframe>');
});
});
})(jQuery);
The issue is that when I run that code in the console of chrome I get "undefined" yet there are no actual console errors on the code it's self. That is when the page loads the code throws no issues, but if I run it in the console I get "undefined" Can some one tell me what I am doing wrong? The link that creates this, is:
<a data-toggle="modal" class="btn btn-success" href="http://adambalan.com/aisis/aisis_update/UpdateNotes/index.html"
data-target="#modal">
Learn More!
</a>
If you go to that actual link, you'll see content that I should see in the box. Also will the box expand to fit the content? that is expand to a specific width then scroll for anything longer?
Jquery 1.9.latest, Twitter Bootstrap 2.3.1
Note: the reason the Jquery is wrapped in (function($){})(jQuery)
is because of WordPress and how it deals with Jquery, it doesn't like the $ because of other script's it uses.
Upade Jquery version 1.9.1 is being loaded in the header of the page. Clicking the link to the source takes me to the Jquery 1.9.1 source. While the code shown above is apart of the html file it's self, how ever it is "executed" AFTER the loading of jquery 1.9.1