var url = 'https://codepad.co/developers?languages%5B%5D=169#filter';
// Parse URL with anchor element
var a = $('<a>', { href: url });
console.log('Protocol: ' + a.prop('protocol')); // https:
console.log('Host name: ' + a.prop('hostname')); // codepad.co
console.log('Path: ' + a.prop('pathname')); // /developers
console.log('Query: ' + a.prop('search')); // ?languages%5B%5D=169
console.log('Hash: ' + a.prop('hash')); // #filter
Parsing a URL
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.