Skip to content

Commit

Permalink
Merge branch 'master' into html5
Browse files Browse the repository at this point in the history
  • Loading branch information
Takayuki Miwa committed Aug 28, 2010
2 parents cb158f2 + 318cdf4 commit ab60e49
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions jquery.history.js
@@ -1,15 +1,28 @@
/*
* jQuery history plugin
*
* sample page: http://www.serpere.info/jquery-history-plugin/samples/
*
* The MIT License
*
* Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari)
* Copyright (c) 2010 Takayuki Miwa
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* Modified by Lincoln Cooper to add Safari support and only call the callback once during initialization
* for msie when no initial hash supplied.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

(function($) {
Expand All @@ -19,7 +32,12 @@
},
get: function(win) {
var hash = ((win || window).location.hash).replace(/^#/, '');
return $.browser.mozilla ? hash : decodeURIComponent(hash);
try {
return $.browser.mozilla ? hash : decodeURIComponent(hash);
}
catch (error) {
return hash;
}
},
encoder: encodeURIComponent
};
Expand Down

0 comments on commit ab60e49

Please sign in to comment.