jQuery Address - Deep linking for the masses

Overview

jQuery Address

The jQuery Address plugin provides powerful deep linking capabilities and allows the creation of unique virtual addresses that can point to a website section or an application state. It enables a number of important capabilities including:

  • Bookmarking in a browser or social website
  • Sending links via email or instant messenger
  • Finding specific content using the major search engines
  • Utilizing browser history and reload buttons

Usage

A basic implementation in pure JavaScript can look like this:

$.address.change(function(event) {  
    // do something depending on the event.value property, e.g.  
    // $('#content').load(event.value + '.xml');  
});  
$('a').click(function() {  
    $.address.value($(this).attr('href'));  
});  

The plugin also provides a jQuery function which can be directly used in the following way:

$('a').address();  

The above snippet can be extended with an additional function that processes the link value:

$('a').address(function() {  
    return $(this).attr('href').replace(/^#/, '');  
});  

By default the plugin automatically adds the appropriate JavaScript event handler to every link that has a rel attribute in the following format:

<a href="/deep-link" rel="address:/deep-link">Deep link</a> 

Changes

01/22/2013 - jQuery Address 1.6

  • Support for jQuery 1.9.
  • Removes the crawlable feature.

11/18/2012 - jQuery Address 1.5

  • Introduces feature detection where possible.
  • Improves event handling.
  • Fixes various issues.
  • Adds a new subtabs sample.

05/04/2011 - jQuery Address 1.4

  • Support for jQuery 1.6.
  • Drops the internal de/encoding magic.
  • Drops the Safari 2 support.
  • Fixes various issues.
  • Updates the Express sample.

02/04/2011 - jQuery Address 1.3.2

  • Support for jQuery 1.5.
  • Issue 48: IE7 "Permission Denied" error.
  • Issue 47: Issues for non-Latin urls and State update to change title on click event.
  • Issue 40: Encoding problem in parameter().
  • Issue 38: Issue when form actions containing query variables.
  • Issue 37: Using live events for form submissions.

11/29/2010 - jQuery Address 1.3.1

  • Issue 26: Values should no longer be only strings.
  • Issue 20: Improves the encoding of special characters.
  • Fixed issue with state value detection.
  • Fixed issue with the global ajaxComplete event.

09/26/2010 - jQuery Address 1.3

  • Support for the HTML5 onpopstate/pushState/replaceState API.
  • Support for tracker function reference.
  • Support for document.domain in IE6/7.
  • Improved value encoding scheme.
  • New State and Express samples.
  • Improved jQuery UI Tabs sample.
  • Improved event cancellation.
  • GA tracker function lookup is performed only against the top window.
  • Fixes an issue with manual address changes in IE7.
  • Removes IE specific code applicable only for local testing.

07/19/2010 - jQuery Address 1.2.2

  • Issue 12: Fixes the opening of tab links in a new browser tab.
  • Issue 11: Fixes the rel attr handling for Ajax loaded links.
  • Issue 10: Cannot turn off Google Analytics page tracking.
  • Fixed lazy loading support.
  • Fixed form submission support in IE.
  • Fixed issue with the href attribute in older versions of IE.
  • Tabs sample improvements.

05/18/2010 - jQuery Address 1.2.1

  • Issue 6: Using links without a href attribute causes an error.
  • Issue 5: Setting parameter = 0 removes it from address.

05/05/2010 - jQuery Address 1.2

  • New queryString, parameter and path setters.
  • New autoUpdate, crawling and wrap options.
  • New generic bind method.
  • New Accordion, Crawling and Form samples.
  • Support for hash fragments as a part of the value.
  • Basic support for forms.
  • Improved onhashchange support.
  • Switched samples to HTML5.
  • Switched to the Closure compiler.
  • JSLint compatibility.
  • Simple test suite.
  • Support for jQuery 1.4.2 and jQuery UI 1.8.

12/23/2009 - jQuery Address 1.1

  • New internalChange and externalChange events.
  • New Events sample.
  • Improved IE support.
  • Frameset support.

04/28/2009 - jQuery Address 1.0

Initial release.

Comments
  • Something worked in v1.2 but not in v1.3 (own encode parameter)

    Something worked in v1.2 but not in v1.3 (own encode parameter)

    I do something like this: $.address.parameter(index,encodeURIComponent($.param(value))); where value is an object and on change i get it back with $.deparam(value) But in v1.3 this doesn't work because of the intern encode. I have changed it a bit and without the encode and decode in the value function it works again. Can you do something to get it work in the next version? Another question is: can you implement such a function for address ... $.address.parameter(index,value) ... where value is an object. ... i think the problem here is just the get the value back not to set it (just a if and a encode).

    opened by geki007 20
  • d not defined in jQuery 1.4.2 with samples uploaded to remote server

    d not defined in jQuery 1.4.2 with samples uploaded to remote server

    I uploaded the tabs folder directly to my host and ran the index.html. Firebug throws me an error stating that function d is not defined, if Firebug is disabled then it runs as intended across all browsers. Just having this issue with Firefox and Firebug with the Script feature turned on.

    I ran into this before when the jQuery file wasn't either loaded or needed to be upgraded. But seeing how the test samples are run as-is I'm not sure what could be causing the problem.

    http://www.helixagent.com/list/tabs/

    opened by eli007s 10
  • Cannot turn off google analytics page tracking

    Cannot turn off google analytics page tracking

    jquery-address is automatically invoking google analytics, and is getting it wrong.

    I think it makes much more sense for me to manage this manually, in my change callback, but I cannot see a way to tell jquery-address to not invoke pageTracker.

    I would argue that, although helpful, doing this is orthogonal to jquery-address' purpose, and therefore should be optional.

    opened by SpoonMeiser 9
  • Update to jQuery 1.7 with new event API `.on()` and update jQuery Address foreign language URLs support on IE7 and IE6

    Update to jQuery 1.7 with new event API `.on()` and update jQuery Address foreign language URLs support on IE7 and IE6

    Update to jQuery 1.7 with new event API .on() (do not forgot to add jQuery 1.7). Update for jQuery Address foreign language URLs support on IE7 and IE6.

    opened by laukstein 8
  • "Syntax error, unrecognized expression: [rel*=address:]" with jQuery 1.5

    Using jQuery 1.5 and the latest code, I get the following exception: Syntax error, unrecognized expression: [rel*=address:]

    The exception is fixed when line 264 is changed from:

                        if (el.is('[rel*=address:]')) {
    

    To:

                        if (el.is('[rel*="address:"]')) {
    

    (Notice the double quotes added.)

    I would guess that Sizzle changed how they parse *= selectors in the latest jQuery. Also, the change above should be backwards compatible with older versions of jQuery.

    opened by tianon 7
  • Dynamically added elements incorrectly reported as external changes

    Dynamically added elements incorrectly reported as external changes

    All commits past c8ba442b57489587d243 incorrectly treat dynamically created links as external changes instead of internal as they should be.

    Also on this note - a feature request... I think it would be helpful if the $.address.change(fn) event, there was a way to determine if the change was internal or external.

    opened by cnanney 7
  • Behaviour of $.address.parameter(name, value, append)

    Behaviour of $.address.parameter(name, value, append)

    Any one knows why when you instance twice $.address.parameter(name, value, append) method it produces two changeEvent identic??

    My code is like this:

    $.address.parameter ('submodulo', id_modulo, false); $.address.parameter ('parametros', params, false); $.address.update();

    And then, its produces the same change event twice...

    What is the way for pass parameters in array mode and... it can solve this?

    opened by ivanrdzmrt 6
  • Let the ability to set function as the tracker option (Fix incldued)

    Let the ability to set function as the tracker option (Fix incldued)

    Currently, we can only set a strong representing a function defined in the window object as the tracker, using the $.address.tracker(value); function.

    In my current project which is relly important regarding memory leak and other stuff, we don't want to create many and many function in the window object.

    The idea here is to check in the _track function if the _opts.tracker is a function or not. If it is, just use it directly. If not, just use the current beahvior.

    THE FIX :: On line 113, we have : var fn = _t[_opts.tracker],

    Just replace it by : var fn = $.isFunction(_opts.tracker) ? _opts.tracker : _t[_opts.tracker],

    and we're done.

    Thanks a lot for your plugin, and including this fix will be great for many people I think.

    opened by nyroDev 6
  • IE 8 with iframe

    IE 8 with iframe

    First off, the plugin is working great with Firefox and IE 7.

    I am experiencing a bug with IE 8. I have a page that uses $.address. Inside that page I have an iframe with a page that uses $.address as well. It seems like the $.address.change inside the page in the iframe overrides the one in the parent window..

    Thanks,

    opened by ParadimeWeb 6
  • Opera 11.11 pushState and replaceState!

    Opera 11.11 pushState and replaceState!

    Opera 11.11 (Opera Presto 2.8) has HTML5 Session History & Navigation support http://www.opera.com/docs/specs/presto28/sessionhistorynav/ , but it still does not work in latest jQuery Address State. Unfortunately it returns hash fallback.

    opened by laukstein 5
  • Collision between deep links and virtual links

    Collision between deep links and virtual links

    Say User A has a browser with HTML5 state support. They send this link to User B:

    http://domain.tld/node

    User B -- whose browser does not have state support -- opens the link, navigates to another node, and sends the link back to User A:

    http://domain.tld/node#!/another-node

    When user A opens the link, the $.address value() is equal to /node#/another-node instead of /another-node. (Curiously the "!" is dropped from the hash value.)

    Is this the expected behavior?

    I noticed that the virtual address is automatically translated on initialization to a real deep link if there's not already a deep link value. That is: http://domain.td/#!/another-node will be translated to: http://domain.td/another-node on an state-enabled browser -- without adding another history entry.

    Thanks so much for your consideration.

    opened by neonsilk 5
  • $.address.change() function is called twice on changing address

    $.address.change() function is called twice on changing address

    I am using jQuery address to update address in my web application.

    $.address.state(url); $.address.update();

    Tracking address change using: $.address.change(function(event) { alert("address.changed"); ... });

    The $.address.change() function is called twice. What could be the reason?

    opened by deepu-scs 0
  • change event is triggered even before the address events are subscribed

    change event is triggered even before the address events are subscribed

    $(_load) in else block is triggered on document readyState is interactive and this trigger the change event before the address events are subscribed in a file that is loaded by the require JS. Because of this, initial change event is not listened.

    opened by raghavendra-kulkarni 0
  • address function not found at plugin load under chrome

    address function not found at plugin load under chrome

    jQuery Address v1.6 jquery v1.8.3 Chrome Version 40.0.2214.115 m loaded via requirejs

    on line 137 within the _load function $('a[rel*="address:"]').address(); The function address is sometimes undefined. I seem to have successfully patched this by moving the function $.fn.address = function (fn) { ... above $.address = (function () {...

    Haven't seen this problem under firefox or IE

    opened by bjj951 2
  • Cannot get it working: TypeError: D is undefined

    Cannot get it working: TypeError: D is undefined

    I'm always getting TypeError: D is undefined.

    So it seems that the latest version is broken with jQuery 2.1.3.

    <script type="text/javascript" src="js/libs/jquery.address-1.5.min.js?strict=false&wrap=true"></script>
    <script src="js/libs/jquery-2.1.3.min.js"></script>
    

    Any solution on this? Already tested an old jQuery version where jquery-address is working. But that is braking some other stuff on my site. So please update jquery-address or please give some tips how it can be used with the latest jQuery version.

    Thanks.

    opened by kwoxer 2
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Click confirmation for the masses <3

jQuery Confirm Action Getting Started <script type="text/javascript" src="./jquery.confirm-action.js"></script> $('.my-button').confirmAction({ ti

SD Elements 6 Sep 25, 2020
RSS feeds for the masses. Create feeds for sites which have none.

RSS Manufaktur A template to build RSS Feeds. In short, RSS Manufaktur takes information of a blog and transforms it into a custom RSS feed for your e

Cyber Design Inframanufaktur 13 Oct 20, 2022
Command-line toolkit for parsing, compiling, transpiling, optimizing, linking, dataizing, and running EOLANG programs

First, you install npm and Java SE. Then, you install eolang package: $ npm install eolang Then, you write a simple EO program in hello.eo file in th

objectionary 17 Nov 17, 2022
An Obsidian plugin for automatically creating notes when linking to non-existing notes

Note Auto Creator for Obsidian Automatically create notes when links are created to them. How to use After enabling the plugin in the settings menu, y

Simon Clement 31 Dec 14, 2022
Obsidian plugin allowing for linking to a heading range, in the [[Page#HeaderA#HeaderB]] extended wikilink format.

Obsidian Link Heading Range Plugin This is a plugin for Obsidian (https://obsidian.md). It allows linking to a heading range, in the [[Page#HeaderA#He

Anthropologie Biblique 7 Nov 14, 2022
Demodal is a browser extension that automatically removes content blocking modals including paywalls, discount offers, promts to sign up or enter your email address and more.

Demodal Demodal is a browser extension that automatically removes content blocking modals including paywalls, discount offers, promts to sign up or en

Elbert Alias 225 Jan 4, 2023
zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

zkPoB is a mobile compatible tool that lets anyone prove they own a Bufficorn (or any NFT) without revealing which Buffi they own or the address they are verifying themselves with

Marto.eth 10 Aug 25, 2022
Converts your IPv4 address to a 4x4 2-bit PNG which you can extract the IP from.

IP-to-PNG Converts your IPv4 address to a 4x4 2-bit PNG which you can extract the IP from. https://www.npmjs.com/package/ip2png Run npm install ip2png

Görkem / Federal 18 Nov 30, 2022
A simple NEXT.js app that lists NFTs within a contract address from a Buildable Flow.

NFT Marketplace Demo This is a basic Next.js app for listing NFTs in a given contract address. The purpose of this repository is to showcase the simpl

Buildable 16 Dec 12, 2022
Detect if a contract has been deployed in the latest (or predefined) block from an address that was previously funded through Tornado.Cash.

??️‍♂️ TORN Detector Detect if a contract has been deployed in the latest (or predefined) block from an address that was previously funded through Tor

Pascal Marco Caversaccio 14 Dec 24, 2022
A rhythm game played in your browser's address bar

URLX URLX is a rhythm game played in your browser's address bar. (no it does not stand for anything it's just the best name i could think of) Hit arro

Colon 37 Dec 21, 2022
A simple CLI Tools to Empty Crypto Wallet & Send to your other Wallet Address

A simple CLI tools to empty crypto wallet & send to your other wallet, Build with Nodejs using Ethers API Run Locally Clone the project git clone ht

Raihan Ramadhani 11 Dec 29, 2022
Web app that generates BOLT11 invoices from an LNURL or Lightning Address.

LNURL Pay ⚡️ Web app that generates BOLT11 invoices from an LNURL or Lightning Address. Getting Started First, run the development server: npm run dev

Sam Samskies 7 Nov 3, 2022
Browser extension that enables you to Log-in as ANY address on ALL dapps

Impersonator Extension Log-in as ANY address on ALL dapps. Impersonator injects into the dapps just like Metamask, but gives you the freedom to set cu

Apoorv Lathey 32 Dec 14, 2022
Claim $ARB airdrop of several wallets at the same time and transfer all the tokens to one address

arbitrum-airdrop-claimer Claim $ARB airdrop of several wallets at the same time and transfer all tokens to one address You need to have Node.js instal

Wizer 4 Mar 21, 2023
Defacement detection with deep learning

In0ri is a defacement detection system utilizing a image-classification convolutional neural network. Introduction When monitoring a website, In0ri wi

Just4Fun Security 47 Nov 30, 2022
clubhouse + google deep voice + gpt3

Omega This repo is code for a machine learning social "turing" test run on Clubhouse. It's a conversational bot that leverages GPT-3 to reply contextu

Thomas Davis 37 Nov 17, 2022