After IP change (via dashboard), how can I redirect dashboard to new URL?

Its JavaScript not Java (big difference).

Have you read the built in help for ui_template? It has an example of getting payload from node-red to client side. Try adapting that.