javascript - Hide a div based on the URL -
Whenever a specific url goes on, I am trying to hide a div.
Something like this: Run your code after page load and element is available for jQuery to hide is . Convert the URL to lower case and compare the user type in the missile case. var url = document.location.href; If (url.indexOf ('http: //nonorperfect.local/asp/loginfull.asp')> = 0) {$ ('# hidebox'). Hide (); } And {$ ('# Hide'). Show (); } Write ("& lt; div id = \" hidebox \ "& gt; \ n"); Write ("& lt; p & gt; test ; \ n"); Write ("& lt; / div> \ n");
$ (function () {var url = document.location.href; if (url.toLowerCase) IndexOf ('http: //onorperfect.local/asp/loginfull.asp') & Gt; = 0) {$ ('# hidebox') Hide ();} and {$ ('# Hide'). Show () ;}});
Comments
Post a Comment