CQ and Javascript redirection

Avatar

Avatar

Tboness

Avatar

Tboness

Tboness

15-10-2015

Good afternoon.

Im trying to write a little javascript, that detects mobile agents.

If the agent is a mobile device, redirect.

<script>
window.onload = function() {
    if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
        // If Mobile: Redirect
        window.location.replace("http://www.externalurl.com");
    }
}
</script>

Unfortunately, CQ doesnt like external URL redirection.
Is it possible, inside CQ to redirect from the client?
And if it is, how does one do it?

Kind regards
Toby

Accepted Solutions (1)

Accepted Solutions (1)

Answers (1)

Answers (1)

Avatar

Avatar

Tboness

Avatar

Tboness

Tboness

15-10-2015

Thanks, will look into that.

But the question still stands.
How does one redirect in javascript to an external URL?

Kind regards
Toby