Skip to content
Advertisement

Tag: redirect

Need simple modification for Javascript Cookie notice wordpress plugin

I followed a tutorial to create cookie notice popup for my wordpress site, it works as expected, I’m not good at javascript, so I want after user click on X button and accept cookies, to be automatically redirected to the same page with ?ok=3 query <script>cookieLaw={dId:”cookie-law-div”,bId:”cookie-law-button”,iId:”cookie-law-item”,show:function(e){if(localStorage.getItem(cookieLaw.iId))return!1;var o=document.createElement(“div”),i=document.createElement(“p”),t=document.createElement(“button”);i.innerHTML=e.msg,t.id=cookieLaw.bId,t.innerHTML=e.ok,o.id=cookieLaw.dId,o.appendChild(t),o.appendChild(i),document.body.insertBefore(o,document.body.lastChild),t.addEventListener(“click”,cookieLaw.hide,!1)},hide:function(){document.getElementById(cookieLaw.dId).outerHTML=””,localStorage.setItem(cookieLaw.iId,”1″)}},cookieLaw.show({msg:”We use cookies to give you the best possible experience. By continuing to visit

PHP go to another page and getElementById

I have 2 pages HTML page with a form PHP action page for the form Based on this, if everything is successful with the form submission, I want to go back to the first page and open up a modal using document.getElementById. I know to do this, I would need the header(“Location: blabla”) function in my PHP page to go

Redirect routes in HTML using Javascript

I have 3 html files that I want to link together. The three files are button.html, option1.html, option2.html and all three files are stored in one src folder. The button.html is a simple webpage that contains two buttons: and the two other .HTML file are regular pages each w/ different content. I’m not sure what I’m doing wrong but even

Redirect ranges of IPs in JavaScript (no .htaccess)

I’m trying to redirect anyone viewing my blog from certain IP addresses (or ranges of IP addresses) to a different page. I found something that works for individual IP addresses, but I can’t figure out how to block ranges of IP addresses – like 123.123.123.* Here’s the script: I’ve found some good advice for modifying .htaccess but I don’t have

Javascript redirect when clicking on a div with a certain id

Here is an example of what I need help with: http://www.arbutusroofing.com/roofing-services/ When the user clicks on “READ MORE” (under each subject or category) and the light grey box pops up with more information, I want it to automatically redirect to another page in 10 seconds. I know how to redirect to a different page when an actual link is clicked,

Advertisement