Jquery if url contains string

<script> $(document).ready(function () { if(window.location.href.indexOf("sent") > -1) { $('.modal-confirm').fadeIn(500); } }); </script>
I'm using this with Gravity Forms in WordPress to redirect to it's current page but I'm adding /?sent. The sent value will trigger a modal widow for email sent confirmation.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.