i am making a script to filter the listing of posts in wordpress with checkboxes, what it is suppost to do is initially grab the link in the adress bar (window.location) and play with it and make conditions to know what checkboxes to be active or not, and the second part on the submit to send the right link to window.location in order to filter accordingly to the sellection of the user….. i’m stuck in the part where i wanted to check the window.location to define the checked/unchecked, but i’m having a hard time using the str.search() or str.match() or the othes on the if’s:
tryed like this with all the String Object Methods from javascript:
var str=window.location;
var res=str.search("example");
if (res!=null) { alert(res) }
I want to check if the word “example” is present in the adress bar in order to know if categorie or tag is active, been a few days around this little detail o.O
or
If you want to get hash value then you should use
and then apply any described above.