I am attempting to use a meta tag to redirect someone if they attempt to go to a specified number of pages. Problem is these pages are pdf files so I cant really add some code to that. Anyway I decided to use a javascript file and import React and ReactDOM from the JS Library. I simply don't know what I am doing wrong with this code though. If anyone could help that would be amazing!
import React from 'react';
import ReactDOM from 'react-dom';
String[] Directory = {"A", "Bunch", "Of", "Website", "Directories", "Here"};
if (window.location.href = "Website name here" + Directory)) {
ReactDOM.render(
<METAhttp-equiv="refresh"content="0;URL=Index.html">,
document.getElementById('app')
);
};
ReactJS redirect
in JavaScript
Posted
I am attempting to use a meta tag to redirect someone if they attempt to go to a specified number of pages. Problem is these pages are pdf files so I cant really add some code to that. Anyway I decided to use a javascript file and import React and ReactDOM from the JS Library. I simply don't know what I am doing wrong with this code though. If anyone could help that would be amazing!
Much Appreciated to whoever can help!