]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Strip hash from remote content URLs
authorScott González <scott.gonzalez@gmail.com>
Tue, 30 Aug 2016 18:37:04 +0000 (14:37 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 31 Aug 2016 11:45:09 +0000 (07:45 -0400)
As of jQuery 3.0.0, hashes are no longer stripped for Ajax requests. This
causes issues in IE <11, so we need to strip this before making the request.

Ref jquery/jquery#1732
Closes gh-1736

ui/widgets/tabs.js

index 209d0febc3f47354cb32050fa73cdd689fb4fc2e..0dd165d4a01b29573f9564810594b68e55adf5fc 100644 (file)
@@ -889,7 +889,10 @@ $.widget( "ui.tabs", {
        _ajaxSettings: function( anchor, event, eventData ) {
                var that = this;
                return {
-                       url: anchor.attr( "href" ),
+
+                       // Support: IE <11 only
+                       // Strip any hash that exists to prevent errors with the Ajax request
+                       url: anchor.attr( "href" ).replace( /#.*$/, "" ),
                        beforeSend: function( jqXHR, settings ) {
                                return that._trigger( "beforeLoad", event,
                                        $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );