This is probably roughly what you’re looking for:
if (screen.width >= 800) {
var redirect = confirm("You are on the mobile site. Would you like to visit our full site instead?");
if (redirect) {
window.location.href="http://TEXTHIDDEN.com/";
}
}
You should invest some time in learning some javascript basics, and use tools like JSLint to check your syntax in the future.
1
solved Javascript Grammar Checking