javascript - JQuery IF document url = "../products.html" Then do this -
how can document url , compare conditional branch?
pseudo code:
if document url = "../products.html" piece of code();
if working loaded html, can try
if(window.location.pathname == "products.html"){ //do here } location.pathname returns file name or path specified location.
in addition, can file name
var p = window.location.pathname.split("/"); var filename = p[p.length-1];
Comments
Post a Comment