Software INFO 0DAY.APPS.0126-0131-IPT List 0126 1-Click.Duplicate.Delete.for.Files.v1.11-DOA 1-Click.Duplicate.Delete.for.Outlook.v4.1-DOA.
What is this?
- Js-collection for node.js - is a powerful, easy queryable, searchable, enumerable (sync/async) javascript collection implements List, Stack, Queue, FixedQueue library for Javascript & node.js.
- My code that runs on V1.0 also runs on V1.1 and it will run on V2.0. So people who purchase systems in a year from now that come with V2.0 won't have to go and download the V1.0 runtime just to run my old app. I can deploy my application by simply copying it to a folder.
- 3.1 Please list any existing documents, specifications, or implementations that describe the technology. Please include links to the documents if they are publicly available. JSR 175 for Java Language Metadata 2.
It's a powerfull URL parser written in JavaScript with a lot of features that it will help you to modify/parse easily a URL without any problem.
Compatible with browser JavaScript and NodeJS (https://npmjs.org/package/kurl).
Demo online
More info
Changelog
Alfred 4 0 3 x 3. v1.2.7 - 01/03/14
- Bug fix in
URL.param
andURL.unparam
.
v1.2.6 - 19/07/13
- Updated examples.
v1.2.5 - 18/05/13
- New license: MIT.
- Added to prototype:
query
(alias tosearch
) - Bug fix in
URL.attr
(port
). - Bug fix and improvements in
URL.param
andURL.unparam
. - Tests are common to browser JavaScript and NodeJS.
v1.2.4 - 09/02/13
- Bug fix in Internet Explorer (dom elements).
- Bug fix in
URL.unparam
.
v1.2.3 - 15/01/13
- Bug fix in
URL.normalize.pathname
: absolute path is converted to canonical. - Location argument now can be a URL instance.
- Code more clean and lightweight.
v1.2.2 - 12/01/13
- Bug fix in
_prototypeSelect
: variablesize
was not declared.
v1.2.1 - 11/01/13
- Added to prototype:
instance
. - Constructor improved.
- Bug fix in
_prototypeSelect
:select
,unselect
,from
,to
. - Bug fix in
URL.normalize.host
: it will be converted to lowercase.
v1.2.0 - 10/01/13
- Added to prototype:
unselect
.
v1.1.0 - 09/01/13
- Added to prototype:
isExternal
,select
,from
,to
. - Renamed prototype methods:
query
tosearch
andqueryHash
tohash
. - URL argument now can be a DOM element.
- Code more clean and lightweight.
- Bug fix and optimizations.
Example
Attributes
The attributes names match with of Location Object Properties (http://www.w3schools.com/jsref/obj_location.asp), except
href
that it's ignored, and auth
that it`s added.Attributes:
protocol
, auth
, host
, hostname
, port
, pathname
, search
(or query
), hash
.API methods
Constructor (URL)
URL(url, location)
url: string, attributes object or DOM element (optional).
location: string, attributes object, DOM element or URL instance (optional).
Creates a new instance with an URL in base to the location introduced.
returns instance.
Local methods (URL.prototype)
url.location
It's a URL instance added automatically by the constructor, and his attributes are used internally to calculate the result in base to the location defined.
url.href()
Builds an URL string in base to current attributes values.
returns URL string.
url.href(url)
url: string, attributes object or DOM element.
Sets a new URL that replaces all attributes.
returns instance.
url.attr()
Gets all attributes.
returns attributes object.
url.attr(name)
name: attribute name (string).
Gets value of the attribute.
returns string.
url.attr(object)
object: attributes object.
Sets multiple values to the attributes.
returns instance.
url.attr(name, value)
name: attribute name (string).
value: attribute value.
Sets a new value to the attribute.
returns instance.
url.search()
Gets search attribute in object format.
Collections 4 0 1 – organize your desktop icons shortcut. returns object.
url.search(name)
name: attribute name (string).
Gets the value of component.
![Jsref Jsref](https://supercompiler.files.wordpress.com/2013/05/110.jpg?w=584)
returns string.
url.search(object)
object: compontents object.
Replaces all compontents by the object introduced.
returns instance.
url.search(name, value)
name: compontent name (string).
value: compontent value. If it's
null
the compontent will be delete.Sets a new value to the compontent.
returns instance.
url.query
Alias to
url.search
.url.hash()
Gets hash attribute in object format.
returns object.
url.hash(name)
name: attribute name (string).
Gets the value of component.
returns string.
url.hash(object)
Jsref V1 13
object: compontents object.
Replaces all components by the object introduced.
returns instance.
url.hash(name, value)
name: compontent name (string).
value: compontent value. If it's
null
the compontent will be delete.Sets a new value to the compontent.
returns instance.
url.isExternal()
Checks if the address is external in base to the location.
returns true or false (boolean).
url.select(name, name, ..)
name: attributes names (string).
Builds an URL string using only selected attributes.
returns URL (string).
url.unselect(name, name, ..)
name: attributes names (string).
Builds an URL string excluding selected attributes.
returns URL (string).
url.from(name)
name: attribute name (string).
Builds an URL string starting from the selected attribute.
returns URL (string).
url.to(name)
name: attribute name (string).
Builds an URL string starting from the beginning to the selected attribute.
returns URL (string).
Global methods (URL)
URL.instance(argv, callback)
argv: array argument of the constructor (optional).callback: function whose context is the new instance (optional).
Create a new URL instance with arguments, calling first to callback and finally to constructor.
returns instance.
URL.getElementURL(element)
element: element object (DOM Element).
Gets element URL (form, a, base, link, img, script, iframe).
returns URL if found or empty string if not found (string).
URL.build(url, location)
url: string, attributes object or DOM element.
location: string, attributes object, DOM element or URL instance (optional).
Builds a new URL based in attributes introduced and doing use location attributes.
returns URL (string).
URL.unbuild(url, location)
url: string, attributes object or DOM element.
location: string, attributes object, DOM element or URL instance (optional).
Unbuilds URL to converting it into a attributes object and doing use location attributes.
returns attributes object.
URL.param(query)
query: query object.
Converts a object into query string.
returns query string.
Jsref V1 1 0
URL.unparam(query)
query: query string.
Converts a query string into object.
Jsref V1 14
returns query object.