Hi Im new to the forums. Here is what Im trying to do. I am grabbing a url, converting it to a string and searching if that string contains the word “true”.
If it finds true i set the page to refresh every 5 seconds. If true isn’t there the page will refresh every 6 minutes. Currently it refresh every 5 seconds no matter if it finds “true” in the string or not.
var url = document.location.href;
var pat = /True/i;
url = String(url);
var word = url.search(pat);
if (word = true)
{
setTimeout(“location.reload()”, 5000);
}
else
{
setTimeout(“location.reload()”, 6000000);
</script>
i think what im doing wrong is that the pattern search doesnt return the value “true” but a number. But Im not sure.