We help IT Professionals succeed at work.

Changing this JQuery

Camillia
Camillia asked
on
If you look at this link, there's a line of code:

error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(textStatus);

Open in new window


Is there anyway NOT to display an alert..instead i want to display the msg in the page in the page...by binding it to lblmsg.Text. How can  I do this?

http://www.dotnetcurry.com/ShowArticle.aspx?ID=515
Comment
Watch Question

.Net Full Stack Developer
Commented:
Hi!

Add the HTML to the page

<form id="form1" runat="server">
<div class="demo">
<div id="lblmsg">
<div class="ui-widget">
    <label for="tbAuto">Enter Email: </label>
     <asp:TextBox ID="tbAuto" class="tb" runat="server">
     </asp:TextBox>
</div>
</div>
</form>

Open in new window


And

error: function(XMLHttpRequest, textStatus, errorThrown) {
                    $("#lblmsg").val(textStatus);
}

Open in new window


Is this want you are looking for?

Thanks!
Michel PlungjanIT Expert
CERTIFIED EXPERT
Top Expert 2009
Commented:
.val?

Either use .text() or .html() for a div - it will wipe the form since you did not close it either
CERTIFIED EXPERT

Author

Commented:
let me try

Explore More ContentExplore courses, solutions, and other research materials related to this topic.