Created
July 24, 2014 22:46
-
-
Save siddharth-pandey/32d30f44c63caf862969 to your computer and use it in GitHub Desktop.
script in app2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function() { | |
$('body').append("<iframe id=\"iembed\" name=\"iembed\" style=\"width: 1200px; height: 1000px; border: none; margin: 0 auto; display: block;\"></iframe>"); | |
var params = $('form').serialize(); | |
$.ajax({ | |
type: "POST", | |
url: "http://localhost:1066/external/index", | |
data: params, | |
crossDomain: true | |
}).success(function (data, textStatus, jqXHR) { | |
//var dstFrame = document.getElementsByName('iembed'); | |
//var dstDoc = dstFrame[0].contentDocument || dstFrame[0].contentWindow.document; | |
//dstDoc.write(data); | |
//dstDoc.close(); | |
var htmlContent = $.parseHTML(data); | |
$(htmlContent).find("script").each(function (i) { | |
eval($(this).text()); | |
}); | |
$('#iembed').html(htmlContent); | |
}).error(function () { | |
alert("error"); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment