Hemi JavaScript Framework

Hemi.util.url

Description

The URL class parses URIs into individual parts. The class also supports resolving relative paths against specified URLs.

Class Index

static Hemi.util.url

version 3.1.0

Utility for parsing URLs.

Index

Method Index

Methods

newInstance

Creates a new Url object.

Syntax

u = newInstance( v, b )

Parameters

Returns

u as UrlInstance: Instance of a Url.

qualifyToHost

Merges the specified URL with the current window URL (document.URL).

Syntax

v = qualifyToHost( u )

Parameters

Returns

v as String: Full url derived from the specified partial URL, and the window URL.

Hemi.util.UrlInstance

version 3.1.0

On object representation of a specified URL.

Index

Example Index

Property Index

Method Index

Examples

Url Utility #1

Demonstrate how to obtain a full URL from a specified partial URL.

Example Code

var sFullUrl = HemiEngine.util.url.qualifyToHost("someFile.html");

Url Utility #2

Demonstrate how to obtain a UrlInstance and access its members.

Example Code

var oUrl = HemiEngine.util.url.newInstance("/path/someFile.html?somequery=1");
var sQuery = oUrl.getQuery();

Properties

object_id

Unique instance identifier.

Syntax

String = object.object_id

object_type

The type of this object.

Syntax

String = object.object_type

object_version

Version of the object class.

Syntax

String = object.object_version

ready_state

Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.

Syntax

int = object.ready_state

Methods

_init

Initializes the UrlInstance.

Syntax

void _init( o )

Parameters

getDomain

Returns the domain name.

Syntax

d = getDomain( )

Returns

d as String: The domain name.

getFile

Returns any file reference.

Syntax

f = getFile( )

Returns

f as String: The file portion of the URL.

getObjectId

Returns the unique id of the object.

Syntax

i = getObjectId( )

Returns

i as String: The unique object instance id.

getObjectType

Returns the type of the object.

Syntax

t = getObjectType( )

Returns

t as String: The type of the object instance.

getObjectVersion

Returns the version of the object.

Syntax

v = getObjectVersion( )

Returns

v as String: The version of the object instance.

getPath

Returns the URL path.

Syntax

p = getPath( )

Returns

p as String: The URL path.

getProtocol

Returns the URL protocol.

Syntax

p = getProtocol( )

Returns

p as String: The URL protocol.

getQuery

Returns any query string.

Syntax

q = getQuery( )

Returns

q as String: The query string.

getReadyState

Returns the state of the object.

Syntax

s = getReadyState( )

Returns

s as int: The object ready state.

qualify

Merges the specified partial URL with the current context URL of the UrlInstance.

Syntax

v = qualify( u )

Parameters

Returns

v as String: Full url derived from the specified partial URL, and the context URL.