how can I Delay and redirect [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have forum v bulletin
I need to redirect a visitor to redirect.php page automatically after a short delay,countdown redirect ,
when he clicks download attachment or external link.
Is there any possible way to do that in a .htaccess (JavaScript) code or any thing ..

it is simple but you should Google for it
var delay = 100;
var button = document.getElementById("id o button");
button.onClick = function(){
setTimeout(function(){
window.location = "http://www.yoururl.com";
},delay)
};

Related

PHP if previous page was certain page on my site then show alert box with message [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
How could I use PHP or Javascript to check if a user's previous page was a certain page on my site and then if so, show an alert box?
This could be circumvented if a person really wanted to.
//on the page for the alert
session_start();
if($_SESSION['lastPage']=='??'){
echo 'alert';
}
//on the page you want to detect if the user came from
session_start();
$_SESSION['lastPage']=$_SERVER['REQUEST_URI'];

Replace a character in window.location.hash url [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
so, I have an anchor that is getting called by replacing the space with a - using the php str_replace, now inside of the javascript hash I want to undo these changes so users will search for the words without these -. any response would be appreciated.
var href = "a-b-c";
href = href.replace(/\-/g,"");
console.log(href);
Will work and replace all "-" instead one.
You can try here
https://codepad.remoteinterview.io/MAZLREUGKE

How to make a button that redirects you to a random page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How to make a simple button saying "Next" that redirects you to a random page in the same tab of the browser? Like a refresh of the page but switching to another page. Just a simple button that changes the page randomly from a number of pages introduced there.
You'll need to do this in three parts.
First, set up an array of websites to redirect to:
var arrayofsites = ["www.google.com", "www.facebook.com", "www.stackoverflow.com"];
Second, randomise which site is selected:
var randomsite = arrayofsites[Math.floor(Math.random() * arrayofsites.length)];
Third, redirect the user to the site randomly chosen:
window.location.replace(randomsite);
Hope this helps.

Click on Anchor tag automatically via C# Code(Windows desktop application) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Click
I have this link in my page , i need to click automatically when i traverse the doc,
After click it show some information the Div, I want to Fetch that information..
So i need this.. Anyone can help me ...
using (var browser = new IE("Your URI)")
{
browser.Link(linkId).Click();
var div = browser.Div(divId);
}

How to prevent Users to use ad blocker on my website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hey any one know how to prevent users to use ad blocker on my site.I just want to request them not to use it on my site..
Make a Javascript file called advertisement.js with this code:
var noadblock = true;
Include it on your page somewhere:
<script type="text/javascript" src="advertisement.js"></script>
The idea is that adblock will block the file called advertisement.js and your var will never be created. So you can use this to take action based on whether the var exists or not:
window.onload = funtion(){
if (noadblock){
// no adblock
}else{
// adblock detected, do stuff here
}
}
Updated cus somone in the comments had a better idea.

Categories

Resources