Inserting text into a textarea using .load() in jQuery
<p>having a bit of a nightmare, I am trying to use jQuery to insert some text taken from a .load() call into a form field (textfield) after a user logs in (basically prefilling some known details). It is #bookName and #bookEmail I am having problems with</p>

<p>The code I am using is:</p>

<pre><code>$.ajax({
        type: "POST",
        url: "/ajax/login.php",
        data: dataString,
        success: function(html) {
            if (html == 1) {
                $("#loginPanel").load("/ajax/login-panel.php");     
                $("#bookName").load("/ajax/getSessionDetails.php #userUsername");
                $("#bookEmail").load("/ajax/getSessionDetails.php #userEmail"); 
                $("#bookingLogin").hide("fast"); 
            } else {
                $("#loginError").html("Sorry, login failed, please try again");
            }
        }
    });
</code></pre>

<p>If I hardcode such as <code>$("#bookName").html("Test Content");</code> it works OK so it must be a problem with the .load call.</p>

<p>I looked around and found some guy suggest something like the following code but I couldn't get it to work:</p>

<pre><code>$.get(htmlBannerUrl, function(data){
  $('textarea').val(data);
});
</code></pre>
