0

HTML Redirect

I have my brightsign player pointed at a URL that is redirecting to another page. The final page simply displays different images every minute based on the system clock. 

When I point the brightsign player at the final webpage it works fine but when I add the redirect page in between it doesn't really work. 

Any reason why this may be an issue - or something I may be missing?

6 comments

  • 0
    Avatar
    Bright Scripters

    Do you have the HTML state set to "Enable external data"?

    Which method are you using for the redirection?

  • 0
    Avatar
    Adi Jain

    We did have the "enable external data" on and below is the html of the page that brightsign is pointing to 

     

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Test Page</title>
    </head>
    <body>
    <script type="text/javascript">
    window.location = "http://DESTINATIONURL";
    </script>
    </body>
    </html>

  • 0
    Avatar
    Bright Scripters

    I'm no expert in JS but this page is showing a slightly different use of the windows.location

    https://www.w3schools.com/js/js_window_location.asp

     

    <html>
    <head>
    <script>
    function newDoc() {
        window.location.assign("https://www.w3schools.com")
    }
    </script>
    </head>
    <body>

    <input type="button" value="Load new document" onclick="newDoc()">

    </body>
    </html>

     

    Have you tried the code in a desktop web browser.

    The bottom of this page has links to Chromium version that matches the browser on the player.

    http://docs.brightsign.biz/display/DOC/HTML5+Best+Practices

     

  • 0
    Avatar
    JRB Technical

    Is this an Apache Server? If so, you might be better off with a .htaccess redirect instead of the in page redirect.

  • 0
    Avatar
    Adi Jain

    We got it working off of the suggested javascript tweak - thanks!

  • 0
    Avatar
    evanmirk
    window.location.replace('http://example.com');

    It's better than using window.location.href = 'http://example.com';

    Using replace() is better because it does not keep the originating page in the session history, meaning the user won't get stuck in a never-ending back-button fiasco.

    If you want to simulate someone clicking on a link, use window.location.href

    If you want to simulate an HTTP redirect, use window.location.replace

    You can use assign() methods to JavaScript redirect to other pages like the following:

    location.assign("http://example.com");

    The difference between replace() method and assign() method(), is that replace() removes the URL of the current document from the document history, means it is not possible to use the "back" button to navigate back to the original document. So Use the assign() method if you want to load a new document, andwant to give the option to navigate back to the original document.

     

Please sign in to leave a comment.