Issues arise in mobile Safari when attempting to load JavaScript files, resulting in

Encountering an issue with my Angular app on mobile Safari during the initial load, where it hangs on a blank page for nearly 2 minutes. Interestingly, the app functions perfectly on other browsers, including Mac Safari and iPad Safari.

Initially, I suspected that the app may have too many JavaScript files causing the delay. To address this, I combined 11 JS files into 3 files, which resolved the problem. Further experimentation revealed that mobile Safari has limitations on the number of JS files allowed on the first page, with 4 being the maximum accepted count.

My question is: Are there indeed restrictions imposed by mobile Safari regarding the number of JS files on the initial page load? Or could this be attributed to misusing AngularJS or HTML5 in any way? It seems odd if Safari enforces such limitations without proper documentation, something I have not found through Google searches.

The original code for my first page appears as:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8>
    <base href="/"/>
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Custom styles for this page -->
    <link rel="stylesheet" href="../styles/main.css">
    <!-- endbuild -->
</head>
<body class="blog-body" ng-app="blog"  ng-controller="blogCtrl">

<div ng-include src="'modules/blogPublish/blogNavBar.html'"></div>
<div ui-view autoscroll='true' class="anchor"></div>

<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../bower_components/underscore/underscore-min.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="../bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script src="../modules/blogPublish/blog.js"></script>
<script src="../modules/blogPublish/ui_effect.js"></script>
<script src="../modules/appError/appError.js"></script>
<script src="../modules/common/underscore.js"></script>
<script src="../modules/common/alert.js"></script>
</body>
</html>   

Answer №1

Did you know that Mobile Safari utilizes a unique feature known as HTTP Pipelining? It's worth noting that this feature may not be compatible with certain web server software. Check out this link for more information: Safari Sends Two HTTP Req. Same Time/Socket

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

Apologies, the system encountered an issue while trying to access the "name" property which was undefined. Fortunately, after refreshing the page, the error was successfully resolved

When the profile route is accessed, the code below is executed: import React, { useState, useEffect } from 'react' import { Row, Col, Form, Button } from 'react-bootstrap' import { useDispatch, useSelector } from 'react-redux' ...

I am having trouble getting Stripe Elements to function properly within Laravel

I'm currently developing a subscription app using Laravel and trying to integrate Stripe Elements, but I'm encountering issues with getting it to function properly. Below is my form: <form method="POST" action="/subscribe" id="payment-form"& ...

The Webix component is experiencing a lack of refreshment

function refresh_group_items(){ //console.log("calling1"); window.setTimeout(function(){ $$("cfg").reconstruct() }, 3000); } $.ajax({ type: "POST", xhrFields:{ withCredentials: true }, beforeSend: function(reque ...

Using React hooks to transfer an item from one array to another and remove it

export default function ShoppingCart() { const classes = useStyle(); const { productsList, filteredProductsList, setFilteredProductsList, setProductsList, } = useContext(productsContext); const [awaitingPaymentList, setAwaitingPaymentList] = us ...

What is causing my css elements to appear larger compared to other instances?

As someone who is not a designer, I find myself doing a lot of cutting and pasting for my side hustles. I believe many others can relate to this experience. Currently, I am working on a personal project that involves using tailwindcss, appwrite, and svelte ...

I encountered the issue: "The specified resource is not a valid image for /public/logoicon/logoOrange.png, it was received as text/html; charset=utf-8."

I encountered an issue when trying to incorporate a PNG or SVG file into my code. What steps should I take to correct this error and enable the images to display properly? import Head from 'next/head' import Image from 'next/image' impo ...

Having trouble getting PostCSS nesting to work with CSS variables in Tailwind CSS and Next.js?

I've been attempting to utilize PostCSS nesting alongside CSS variables, but unfortunately the CSS variables are not being converted at all. Instead, I am seeing Invalid property value in the DOM for CSS Variables. The tailwind.css file I have inclu ...

What is the best way to enhance a state's capabilities in Machina.js?

When using Machina.js (version 0.3.6), how can I instantiate a modified FSM constructor where both the child and parent FSMs define behaviors in the same states? Here is the code snippet: var _ = require('lodash'); var machina = require('m ...

Incorporate jQuery into Laravel 5.4 mix for enhanced functionality

After being familiar with Laravel 5.1 mix (elixir), I decided to give Laravel 5.4 mix a try. I combined my libraries into vendor files. mix .styles([ './node_modules/bootstrap/dist/css/bootstrap.css', './node_modules/font-awesome/c ...

If other options fail, Else If may not be a suitable choice

This is the process: switching from Issue: x==0||1 to x==0||x==1 etc. This code runs from an .html file <body> <div class="" id="pimg1"> </body><script> var x=new Date().getMonth(); if (x == 0||x == 5||x == 2){docu ...

What is the purpose of running the same function after altering the ID of a link?

I have been working on creating an add/remove favorite feature using jQuery and PHP. The addfavorite function is functioning properly, but I am facing issues when changing the id attribute of the link from addfavorite to removefavorite. Despite the ID bein ...

Prevent redirection when submitting and show an error message instead

I implemented a login system where, upon entering the correct username and password, a token is stored in local storage. If there's an error with the credentials, an "Login Unsuccessful" message is displayed. Everything was functioning correctly until ...

What is the most efficient way to clear the input field in Angularjs when the backspace or delete keys are pressed?

Is there a way to reset an input field with AngularJS when the backspace or delete keys are pressed? I've implemented this fantastic directive, and it's been working great, except for when the user uses the backspace or delete key to clear the f ...

Tips on passing a variable into a controller using jQuery AJAX from the URL

Can you help me figure out how to pass an id to a function in the controller? I keep getting an error saying it cannot find the method in the controller. Here's my view: function Delete1(id) { if (confirm("Are you sure?")) { $. ...

conceal parent window element upon clicking an image within an iframe

I'm facing a challenge with hiding certain buttons in a parent window when opening a modal by clicking an image inside an iframe. Below is the code snippet that I am using: In the parent window - <iframe id="gallery" src="links/gallery.html" wid ...

Switch language by entering a specific URL (VueJs)

I have successfully integrated localisation using vue-i18n. In my main.js file: import Vue from 'vue' import { i18n } from './plugins/i18n' import Cookie from "vue-cookie"; if (!Cookie.get('locale')) { Cookie.set(' ...

Iterate through each key in the response JSON object using a variable named "a

Here is a snippet of my code: var roomid= roomIds[i] const Availabilitydata = await AvailResponse.json(); availableroomsArray.push(Availabilitydata); app.get("/api/availability", (req, res) => { res.json({ indicateur: availableroomsA ...

Utilizing AJAX in Liferay portlets

I am having a problem with my AJAX request to a portlet. Let me show you the code and then explain the issue: The jQuery AJAX: jQuery("#operation").click(function() { var url = '<portlet:resourceURL id="getDataResourceURL"></po ...

The jQuery blur event triggers only on the first occurrence

Working on a script to handle a shopping cart, I ran into an issue with the blur event on the input field used to modify product quantity. The problem is that the event only triggers once and requires a page refresh to work again. Currently, this is my s ...

Unlocking the Power of Javascript Promises in FileReader

I am facing an issue with my code. Here is the HTML snippet: <input type='file' multiple> And this is my JavaScript code: var inputFiles = document.getElementsByTagName("input")[0]; inputFiles.onchange = function(){ var fr = new File ...