Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 56d705aa5d
Fetching contributors…

Cannot retrieve contributors at this time

65 lines (41 sloc) 1.577 kB

sitename.js 1.1.0

Determines a website’s canonical domain name (disconnect.me, abc.net.au, even byoogle.appspot.com).

Example

<script type="text/javascript" src="sitename.js"></script>
<script type="text/javascript">
  var sitename = new Sitename;

  sitename.get('https://disconnect.me/', function(domain) {
    jQuery('#sitename').html(domain); // sitename.js automagically loads jQuery.
  });
</script>
<span id="sitename">A canonical domain name.</span>

Constructor

Sitename()

A class for determining a website’s canonical domain name.

Methods

{Sitename} get({string} url, {function(string)} callback)

Determines a canonical domain name.

Parameters

url A website’s absolute URL.

callback A continuation, to execute when the method completes, that takes a canonical domain name.

Return value

The domain object.

Author

Brian Kennish

License

Copyright 2012 Disconnect, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See also

jQuery

Jump to Line
Something went wrong with that request. Please try again.