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
function _make_function(args, body) { | |
return new Function(args, body); | |
} | |
// helpers | |
var $ = _make_function("id" ,"return document.getElementById(id)") | |
var _isarray = _make_function("obj","return obj instanceof Array;") | |
var _error = _make_function("txt", "throw new Error(txt)") | |
var _is_undefined = _make_function("obj","return obj == undefined") | |
function _add_repr_to_object (o, r) { |
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" |