We help IT Professionals succeed at work.
Get Started

jquery my html value of a div disappears after showing

nuritat
nuritat asked
on
618 Views
Last Modified: 2012-08-21
Hi,


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) {
                        $("#LogResponse").html(data.message);
                        $("#LogResponse").show();
                        if (data.success) {
                            $("#LogResponse").after('<span class="error">bla bla bla</span>');
                        }        
                    }, 'json');
        });


the html is:


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


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?

thanks
Comment
Watch Question
Information Systems Manager
CERTIFIED EXPERT
Top Expert 2012
Commented:
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