var iframeDoc = document.querySelector( '#inlineFrame' ).contentWindow.document; iframeDoc.open( 'text/html', 'replace' ); iframeDoc.write( data ); iframeDoc.close(); } } ); }, error: function () { alert( "error" ); } } ); } ); $( 'a[href$="#Modal"]' ).on( "click", function () { console.log( "hey" ); $( '#profileModal' ).modal( 'show' ); } );