write content to newly open window using jQuery
<p>I have a function written on some another page load event.i want to open new page and write content (such as textbox value) to newly opened page</p>

<pre><code>function updateUser() {
    $("button").on("click", function () {
        var code = $(this).attr('id');        
        $.ajax({
            url: '/ajaxExecute.aspx?Fn=GETUSERFORUPDT',
            type: 'POST',
            context: document.body,
            data: 'Code=' + code,
            cache: false,
            success: function (response) {
                if (response != 'undefined') {
                    window.location = 'AddEditUser.aspx';
                    $('#txtUserName').val(response.split("|")[0]);                    
                }                
            }
        });
    });
}
</code></pre>

<p>Textbox with id <code>txtUserName</code> lies in page <code>AddEditUser.aspx</code> &amp; <code>function updateUser()</code> load in another .aspx page</p>

<p>My Page loads but not able to get value in <code>textbox</code> as i am able to get value using <code>alert()</code></p>

<p>I refer this links but still cudnt figure out</p>

<p><a href="http://stackoverflow.com/questions/3841100/write-content-to-new-window-with-jquery">Write Content To New Window with JQuery</a></p>

<p><a href="http://stackoverflow.com/questions/1225558/jquery-new-window-with-content-from-modal-content-on-opener-page">jQuery new window with content from modal content on opener page</a></p>
