nuritat
asked on
jquery my html value of a div disappears after showing
Hi,
my login procedure looks like this:
$("#btnLogin").click(funct ion() {
var email = $("#email").val();
var pw = $("#pw").val();
$.get("../Admin/loginForum .aspx", { email: email, pw: pw, mem: "mem" },
function(data) {
$("#LogResponse").html(dat a.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:TextB ox>
</td>
</tr>
<tr>
<td>
password</td>
<td>
<asp:TextBox ID="pw" runat="server" TextMode="Password"></asp: TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnLogin" runat="server" Text="login" Font-Bold="True" />
</td>
</tr>
<tr>
<td colspan="2" >
<div id="LogResponse"></div></t d>
</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
my login procedure looks like this:
$("#btnLogin").click(funct
var email = $("#email").val();
var pw = $("#pw").val();
$.get("../Admin/loginForum
function(data) {
$("#LogResponse").html(dat
$("#LogResponse").show();
if (data.success) {
$("#LogResponse").after('<
}
}, '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:TextB
</td>
</tr>
<tr>
<td>
password</td>
<td>
<asp:TextBox ID="pw" runat="server" TextMode="Password"></asp:
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnLogin" runat="server" Text="login" Font-Bold="True" />
</td>
</tr>
<tr>
<td colspan="2" >
<div id="LogResponse"></div></t
</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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
You also need to add event as a parameter in the click function as above