I've got the following code, but it's not working in IE, 9 specifically. Maybe other versions, too.
The function is running, if I alert, it does fire, but in IE it's not replacing the text when the button is clicked again. In other browsers, every time a user clicks the button #gen_password, it reloads a new password from the remote file. In IE, it never replaces it.
Can anyone see what's wrong?
Thanks.
$("#gen_password").live('click',function(){
$("#password_messg").html('');
var before = $("#gen").html();
$("#gen").html("<image alt='Loading...' src='ajax_loader.gif' />");
$("#password_container").load('random.php', function(){
$("#gen").html(before);
});
$("#password_container").show();
return false;
});
Here's the HTML it's acting on:
<fieldset class="blue_border"><p id="password_messg" class="message"></p><legend>Change password</legend>
<form method="post">
<dl class="zend_form">
<dt></dt>
<dd>
<input type="hidden" name="pwpid" id="pwpid" value="<?php echo $this->login_data['id'];?>" />
<span id="password_container" class="disabled"> </span>
<input type="hidden" name="savepw" id="savepw" value="1" />
</dd>
<dt></dt>
<dd id="gen">
<button id="gen_password">Generate a Password</button>
<button id="save_password">Save</button>
</dd>
</dl>
</form>
</fieldset>
test
to make sure it's not the image section... – i-CONICA Mar 12 '12 at 10:15