This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why use plugin in a separate file for something that takes less than 20 lines of code? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All placeholders plugins I could find were inserting placeholder in the field itself. | |
This approach has many disadvantages. | |
1. If your JavaScript code throws an exception you are stuck with the wrong field content that can be submitted. | |
2. Few of these plugins work for password fields, and those that do are quite complex. | |
3. You can't style placeholder created this way differently from the field content. | |
So I created placeholders that are additional elements that places themselves on top of the fields and show/hide depending on whether the filed is empty. | |
Placeholder element created with this function is span.placeholder, it should be added to the list of CSS rules used to style placeholders. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's easy to make popup windows without Twitter bootstrap or Javascript. | |
Example below uses :target pseudoclass to do it. | |
It adds one extra <a> tag to HTML, used as anchor (see comments in HTML file). | |
And it adds just 2 lines of CSS to show popup and its background. | |
You can have as many popups as you need - they will all work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |