c# - open browser instance from $ajax -
i trying open new browser instance popup show contents of file not staying in same page?
$(document).ready(function (event) { $.ajax({ type: 'post', url: "/home/index" }); }) public actionresult index() { return file(@"c:\textfile1.txt", "text/plain"); }
what without ajax?
$(document).ready(function (event) { window.open('/home/index', 'window name') })
if require ajax, because need post data
$(document).ready(function (event) { $.ajax({ type: 'post', url: "/home/index", success: function( data ) { var win = window.open('about:blank', 'window name'); $(win.document.body).append(data); } }); })
Comments
Post a Comment