Skip to content

Instantly share code, notes, and snippets.

@siddharth-pandey
Created July 24, 2014 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siddharth-pandey/32d30f44c63caf862969 to your computer and use it in GitHub Desktop.
Save siddharth-pandey/32d30f44c63caf862969 to your computer and use it in GitHub Desktop.
script in app2
<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