javascript - Show content on certain URL -
javascript - Show content on certain URL - i using online store solution allows me set simple online shop. cannot utilize code other html/css/javascript. i have set in simple image-slider in template. want slider shown on frontpage. shown on every-page. can utilize javascript functions says this: "if url "www.example.com" show image-slider else hide it." something maybe? <script> $(function() { if(document.url == "http://example.com/") { ... ... </script> thanks on beforehand :) i don't know exact circumstances of you're trying or why you'd need it, but if (location.href == "http://example.com") should it. location.href returns url of page, "document.url" in example. if you're looking parts of url, cool tip found here. var parser = document.createelement('a'); parser.href = "http://example.com:3000/pathname/?search=test#hash"; parser.hostname; ...