-
-
Save danyelhenrique/505a852687d5eb523a699c087ba3bfa4 to your computer and use it in GitHub Desktop.
vtex get serch url on page
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 getSearchUrlVtex() { | |
| var url, content, preg; | |
| jQuery("script:not([src])").each(function () { | |
| content = jQuery(this)[0].innerHTML; | |
| preg = /\/buscapagina\?.+&PageNumber=/i; | |
| if (content.search(/\/buscapagina\?/i) > -1) { | |
| url = preg.exec(content); | |
| return false; | |
| } | |
| }); | |
| return url; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment