Comments (4)
@pixelthing Great catch, thanks!
It might not be the craziest idea to provide a fallback solution that toggles between separate <input type="text">
and <input type="password">
elements, in case IE < 9 is a requirement for someone. The plugin's simple enough that it seems like a shame for this one issue to prevent folks from using it in IE 8 entirely.
from hideshowpassword.
@pixelthing Just to give you an update, the replacement solution proved a bit untenable... it turns out you can't even read an <input>
type property more than once in IE < 9, so it becomes really hard to maintain styles and attributes for duplicate elements.
The good news is that I've got a test working that seems to figure out if that feature is supported or not. The next major plugin update will use this to fail more gracefully, but in the meantime I thought I'd pass it along in case it's helpful for determining whether or not to enable the plugin:
var canSetInputAttribute = (function(){
var body = document.body
, input = document.createElement('input')
, result = true;
if (! body) {
body = document.createElement('body');
}
input = body.appendChild(input);
try {
input.setAttribute('type', 'text');
} catch (e) {
result = false;
}
body.removeChild(input);
return result;
}());
if (canSetInputAttribute) { /* hideShowPassword, etc. */ }
from hideshowpassword.
brilliant - much better feature detection than the method I was using...
thanks.
from hideshowpassword.
@pixelthing Just released version 2 of the plugin, and it should fail much more gracefully now without any additional checks.
from hideshowpassword.
Related Issues (20)
- Auto left and right margins not inherited in Firefox HOT 1
- Wrapper margins are still inherited even when not included in the wrapper object's inheritStyles array HOT 4
- Rely more on CSS and less on JS for styles
- Split basic hide/show functionality from toggle UI
- Rendering issue when displayed on a modal form. HOT 2
- browserify require is broken when jQuery versions mismatch HOT 5
- Modernizr >= 2 and >= 3 use touchevents insted touch HOT 3
- Bower install fails HOT 5
- Can we do this with just CSS in supported browsers?
- Attach to hover event HOT 4
- Can't change button title "Show Password" HOT 2
- hideToggleUntil is not documented HOT 3
- Possibility to use existing wrapper (parent) element HOT 1
- Some of the demo doesn't work on Windows 8.1 touchscreen PC in Chrome, Firefox HOT 23
- Disable added inline styles HOT 2
- jquery dependency in wordpress HOT 2
- Keyboard focus lost on toggle in iOS Safari 12.1.2
- About this plugin, how can the focus skip the display password button after pressing the [TAB] key? HOT 1
- Configure globally HOT 5
- Classes should be in kebab-case HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hideshowpassword.