javascript - Redirection to custom URL scheme not working -
i have android mobile app custom url scheme like: mycoolapp://
i want redirect users sent page on website mobile app using url scheme. have following js code runs on page load:
<script> window.location = 'mycoolapp://'; </script> this reason nothing.
if make click, works. this:
<button onclick="window.location = 'mycoolapp://';">open app</button> or regular link, works well:
<a href="mycoolapp://">open app</a> so onclick, works onload, doesn't!
i'm testing on google chrome
try
window.location.replace("mycoolapp://"); this equivalent header function php.
Comments
Post a Comment