I want the origin page to be an external server page.

Asked 2 years ago, Updated 2 years ago, 32 views

This is my first application development at monaca.

I wanted to read www on the server instead of www in the native language, so I decided to call the URL online in location.href.

It works with the debugger, but when you build it and install it on a real machine, the specified page does not appear and remains stuck in the splash image.

Do I need to implement it in a different way?

index.html

<script type="text/javascript">
function startPage(){
 location.href="http://~";
}
</script>

<body onload="startPage();">
</body>

monaca

2022-09-29 22:28

1 Answers

Even though HTML is ready, I don't think the device is ready.
The splash stops in JavaScript, so
Transitions before the splash finishes loading will not work.
It will harden with a splash.
How about the following?

 document.addEventListener(
    'device ready', 
    function(){
        location.href="https://www.google.co.jp/";
    }, 
    false
);

Or stop splashing yourself and transition.


2022-09-29 22:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.