mathiasbynens / jquery-placeholder

A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet
https://mths.be/placeholder
MIT License
3.98k stars 1.34k forks source link

I find a problem when i used this pluge in IE9 and the web page has '<a href="javascript:void(0)">test</a>' #225

Closed cuimb closed 9 years ago

cuimb commented 10 years ago

I find a problem when i used this pluge in IE9 and the web page has 'href="javascript:void(0)".It will trigger this function:

// Clear placeholder values upon page reload
$(window).bind('beforeunload.placeholder', function(e) {
$('.placeholder').each(function() {
this.value = '';
});
});

Actually, the page not redirect, but the input elements which use placeholder are white. Especially, the password is visible when i write it again. I edit it like this:

$(window).bind('beforeunload.placeholder', function(e) {
$('.placeholder').each(function() {
clearPlaceholder();
});
});
amerikan commented 9 years ago

This is known issue. See https://github.com/mathiasbynens/jquery-placeholder/issues/74 Marking this a duplicate.