I am working on a conditional () to trigger the document.getElementById("testchange")
script. I need it to trigger only from the /eng/ folder onward not just the example.com/eng/ URL which is how its configurred now with the window.location.pathname == '/eng/'
if(localStorage.getItem('textSet2') && (window.location.pathname == '/eng/')) {
document.getElementById("testchange").innerHTML = "Empieza Ya!";
}
So what is the substitute for window.location.pathname ==
to trigger the script only for a specific folder name onward, or trigger the script for the example.com/eng/ folder
and its URLs inside of the folder like example.com/eng/house.php and example.com/eng/cat.php
and so on?
The window.location.pathname == '/eng/' only
works for the example.com/eng/ URL
not the URLs inside of it like example.com/eng/house.php
, etc. So any ideas of a command to detect folder names and the URLs inside as well. If so how would it look like inside the script i have. Thanx a lot.