jquery - Javascript: Show XML If Word Is In URL -
i'm wanting make changes page. "preview" page in blogger when go preview post. far know there no conditional statement it.
the preview page url looks this: http://mydomain.com/b/post-preview?token=###############
so i'm trying use javascript "hey, if /b/post-preview
in url, show hide element".
i have been unsuccessful. attempt(and there others):
$(document).ready(function() { if ((window.location.href) === '/b/post-preview') { $('homepage-slider-section').css('display', 'none'); } });
html:
<div id="tobeornottobe">to or not be, question</div>
javascript:
$(document).ready(function () { console.log(window.location.href); if (window.location.href.indexof('fiddle') !== -1) { $('#tobeornottobe').css('display', 'none'); } });
Comments
Post a Comment