window.location – MDN

window.location – MDN.

hash the part of the URL that follows the # symbol, including the # symbol.
You can listen for the hashchange event to get notified of changes to the hash in supporting browsers.
#test
host the host name and port number. [www.google.com]:80
hostname the host name (without the port number or square brackets). http://www.google.com
href the entire URL. http://%5Bwww.google.com%5D:80/search?q=devmo#test
pathname the path (relative to the host). /search
port the port number of the URL. 80
protocol the protocol of the URL. http:
search the part of the URL that follows the ? symbol, including the ? symbol. ?q=devmo
This entry was posted in Code Snippets. Bookmark the permalink.

One Response to window.location – MDN

  1. rg443 says:

    function showBookmark (sBookmark) {
    /*
    * nDuration: the duration in milliseconds of each scroll
    * nFrames: number of frames for each scroll
    */
    var nDuration = 500, nFrames = 10,
    nLeft = 0, nTop = 0, oNode = document.getElementById(sBookmark),
    nScrTop = document.documentElement.scrollTop,
    nScrLeft = document.documentElement.scrollLeft;

    for (var oItNode = oNode; oItNode; nLeft += oItNode.offsetLeft, nTop += oItNode.offsetTop, oItNode = oItNode.offsetParent);

    for (var nItFrame = 1; nItFrame < nFrames + 1; nItFrame++) {
    setTimeout("document.documentElement.scrollTop=" + Math.round(nScrTop + ((nTop – nScrTop) * nItFrame / nFrames)) + ";document.documentElement.scrollLeft=" + Math.round(nScrLeft + ((nTop – nScrLeft) * nItFrame / nFrames)) + ";", Math.round(nDuration * nItFrame / nFrames));
    }
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s