We help IT Professionals succeed at work.
Get Started

jquery my html value of a div disappears after showing

nuritat asked
Last Modified: 2012-08-21

my login procedure looks like this:

  $("#btnLogin").click(function() {
            var email = $("#email").val();
            var pw = $("#pw").val();
            $.get("../Admin/loginForum.aspx", { email: email, pw: pw, mem: "mem" },
                    function(data) {
                        if (data.success) {
                            $("#LogResponse").after('<span class="error">bla bla bla</span>');
                    }, 'json');

the html is:

 <table id="tblLoginForum" class="News" width="100%">
                        <td colspan="2"><b>Login Forum</b></td>
                            user name (Email)</td>
                            <asp:TextBox ID="email" runat="server"></asp:TextBox>
                            <asp:TextBox ID="pw" runat="server" TextMode="Password"></asp:TextBox>
                            <asp:Button ID="btnLogin" runat="server" Text="login" Font-Bold="True" />
                        <td colspan="2" >
                           <div id="LogResponse"></div></td>

after the login is pressed and the $get returns with success,
the return data is placed in the right place and the messege below as well,
but if seems that the page is being refreashed after a few seconds and everything disappears

Can anybody tells me why? and what should I do to avoid it?

Watch Question
Information Systems Manager
Top Expert 2012
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE