Creating a Phonegap hybrid application that uses JavaScript redirection can cause an absolute positioned element to intermittently blink, revealing the content that lies

Currently, I am developing a Cordova project for both iOS and Android platforms.

Within my project, I have two main pages: index.html and home.html. Each page contains an absolute positioned div (with loading feature) that is visible by default. Here is the structure:

<body>
    <div id="loading_page" class="loading_page"></div>
    <section> content here </section>
</body>

Accompanied with the following CSS styling:

body {
    background-color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #00665d;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -ms-touch-action: none;
    height: 100%;
    width: 100%;
    overflow: hidden;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}
.loading_page {
    background: #fff;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 25;
}
section {
    position: absolute; /* tested with relative, too */
    top: 85px;
    left: 75px;
    right: 15px;
    bottom: 0;
}

The issue arises when switching from index.html to home.html using JavaScript command

window.location.href = "home.html"
, causing a blinking effect on iOS devices where the loading screen momentarily disappears before fully redirecting to home.html.

Seeking advice on how to resolve this flashing problem specifically observed on iOS devices.

Answer №1

To have complete control over the pages and their behavior, consider organizing them as 'page sections' within a single HTML file:

I adopted this approach to eliminate any blink or flickering issues in my case. It's also worth checking your JavaScript code in the console for any potential problems.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The combination of JQuery, bootstrapValidator, and ajaxForm (created by Malsup) resulted in no data being

My current goal is to create a feature where the user can select a file by clicking an icon. If the selected file is valid, it should automatically start uploading and display a progress bar. Once the upload is complete, the data will be submitted via AJAX ...

A guide on sharing an express.js response object with a different module

In my server.js file, I am attempting to pass an Express response object to a different module. Here is how I have implemented it: const room = require('../controller/rooms_controller') app.post('/rooms', function(req, res){ var na ...

Attain the ability to distinguish errors in Promises

Context In my project, I have implemented a REST API that interacts with MongoDB using Node.js and Express. The issue at hand involves handling errors based on different scenarios when making requests to the NoSQL database. Challenge The current impleme ...

Input for uncomplicated changing identifier

I am looking to create types for dynamic keys that will be of type number. I have two similar types defined as follows: type UseCalculatePayments = () => { totalPayments: number; aggregate: number; condition: boolean; }; type UseCalculateCommissio ...

Verify if a specific key is present in associative arrays

Can you please explain the correct way to check for the existence of a key in associative arrays? For instance: var mydata = { key1: '', key2: { subkey1: { subkey1_1: { value1: '' ...

NodeJS Passport redirection mechanism

I am currently working on implementing user redirection using Passport in my NodeJS and Express Backend script. The issue I am encountering is that the login page is not the default homepage, but rather located at: localhost:3000/login I have successfull ...

Is the JavaScript progress bar dysfunctional when used with object-oriented JavaScript code, but functions properly with arrow functions?

After posting a question about the JavaScript progress bar not working with object-oriented JavaScript code on Stack Overflow, I decided to try rewriting the script using arrow functions. Here is the new code: document.getElementById("barButton").addEve ...

Utilizing Card Images in a Slider with Bootstrap 4

Is there a way to turn the card-image-top section into a slider, especially for mobile use? I want to showcase multiple product images in this section for my customers to see. Any simple solutions for achieving this? <div class="card" style= ...

Placing a crimson asterisk beside the input field within Bootstrap

Trying to insert a red * at the end of my input field using bootstrap, but all my attempts so far have been unsuccessful. Is there a way to align the Currently experiencing this issue: https://i.stack.imgur.com/61pzb.png Code snippet: .required-after ...

A guide on showing POST values from javascript XMLHttpRequest() in php

I have encountered an issue where I am using the XMLHttpRequest() javascript function to send parameters in Json format to another php page, but for some reason $_POST['appoverGUID'] is not receiving the posted values. Below is my Javascript cod ...

Using HTML5 Canvas: Implementing an Image.onload() function through Image.prototype

I am trying to create a simple function that will refresh the canvas automatically when an image is loaded. The idea is to be able to use code like this: var map = new Image(); map.onloadDraw(); map.src = "images/" + worldmapCanvasShapeImage; Currently, ...

Is it possible to employ getBoundingClientRect() for several elements sharing the same class?

I'm in the process of implementing sticky navigation on my website that will dynamically change as users scroll through different sections. Specifically, when scrolling over a section marked with the class .dark, I want the logo and text color to swit ...

Recursive function in JavaScript with error handling using try-catch block

Within my nodejs script, I have implemented a system to generate dynamic tables and views based on the temperature data recorded for the day. On some occasions, the creation of these tables is hindered if the temperature falls outside of the normal range ...

Click events are not functioning properly after an AJAX request is made

$(document).ready(function () { var user = 1; $("a.like").on("click", function () { var article = $(this).attr('data-article'); $.ajax({ type: "POST", url: "WebService.asmx/Like", ...

Does the value obtained from a dropdown list change only once?

I have implemented a jQuery Ajax function to pass a value as a parameter to my controller, and receive HTML data back to update my cart table. $(document).ready(function () { $(".Quantity").change(function () { var ProID = $(this).attr("data" ...

Is there a way to synchronize the autohide duration for both the LinearProgress MUI and SnackBar components?

Can someone help me align my SnackBar with the LinearProgress so that they both have an auto-hide duration of 4 seconds? I've been struggling to figure it out for hours and haven't found a solution yet. Could the issue be in the useEffect part of ...

Is it possible in Javascript to verify if a different script has been triggered?

I recently created a pop-out menu for a website using HTML and Javascript. The menu currently has a button that opens a div container with a close button inside it. While the buttons are functioning properly in hiding the div, the elements within the div d ...

Creating the Perfect Layout: Unveiling the Secrets of Bootstrap 4

Currently in the process of working on a website, I have encountered a particular challenge regarding the layout design using Bootstrap 4. (Highlighted in Red) https://i.sstatic.net/k8bKv.png The issue at hand is that the first column is a col-md-7 and t ...

Enhancing the angular-ui-bootstrap typeahead module

Currently, I am using the typeahead feature from angular-ui-bootstrap to allow users to select a person's name or add a new name if it is not available in the options. I have customized the getMatchesAsync function with the following code: if(scope ...

Is it possible to transmit an array using $.ajax and specify the dataType as json?

I am currently attempting to send a JavaScript array to my .php file handler and store it in my database. Although the request is successful, it seems like my array isn't being posted/saved correctly. When I check the POST request source, it shows up ...