Last active
September 10, 2020 10:10
-
-
Save kaskad88/3446091b83a52d20de34b6f5dbe9d2dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
'use strict'; | |
$( document ).ready(function() { | |
$( '.jet-ajax-search__form' ).on( 'submit', function( event ) { | |
event.preventDefault(); | |
var $form = $( this ), | |
action = $form.attr( 'action' ), | |
$inputs = $form.find( '[name]' ), | |
url = ''; | |
url += action + '?'; | |
$inputs.each( function() { | |
url += $( this ).attr( 'name' ) + '=' + encodeURIComponent( $( this ).val() ) + '&'; | |
} ); | |
window.open( url, '_blank' ); | |
}); | |
}); | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment