Issue with Phonegap iOS - device ready event is not triggering other events

I've exhausted all options but still can't seem to trigger the deviceready event. Strangely enough, I was able to fire the pause event without any issues. My current Cordova version is 2.0.0. Here's a snippet of my code:

<html>
<head>

    <title>Taxiii</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale =1, user-scalable=no" />   
    <meta name="apple-mobile-web-app-capable" content="yes" /> 
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />  
    <link rel="stylesheet" href="reset.css" type="text/css" media="all" />
    <link rel="stylesheet" href="style.css" type="text/css" media="all" />

    <script src="cordova-2.0.0.js"></script>
    <script src="jquery.js"></script>
    <script src="xui.js"></script>
    <script src="iscroll.js"></script>
    <script src="loadData.js"></script>
    <script src="loadServices.js"></script>
    <script src="js.js"></script>
    <script src="methods.js"></script>
    <script src="setSizes.js"></script>
    <script src="map.js"></script>
    <script src="http://maps.googleapis.com/maps/api/js?libraries=places,geometry&sensor=true"></script>

    <script>

       function onLoad() {
          document.addEventListener("deviceready", onDeviceReady, false);
       }

       function onDeviceReady() {
          alert("123")
       }

    </script>

</head>
<body onload="onLoad()">
...

Despite trying various syntaxes, none seem to be effective.

Answer №1

Why not try removing the function onLoad() wrapper around

document.addEventListener("deviceready", onDeviceReady, false);
? Let us know if it makes a difference.

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

Utilizing JavaScript Event Listener to Identify the Relevant PHP File for Display

I have incorporated two separate PHP files in my code: tabs.php accordion.php Both files iterate through the same dataset, but present the information in different ways. The choice between displaying tabs or accordions depends on the user's screen s ...

How to Implement Button Disable Feature in jQuery When No Checkboxes Are Selected

I need help troubleshooting an issue with a disabled button when selecting checkboxes. The multicheck functionality works fine, but if I select all items and then deselect one of them, the button disables again. Can someone assist me with this problem? Be ...

Firebase ref.on('value') will repeatedly trigger, even if no changes have occurred

My current setup involves using an event listener to monitor changes in my real-time database. const [chats, setChats] = useState({}); const ref = db.ref(`users/${sender}/chat/`); ref.on('value', (snapshot) => { const data = snapshot ...

retrieving the value added to an array

I used a script to populate an array with image sources: var imgs = document.getElementsByTagName("img"); var imgSrcs = []; for (var i = 0; i < imgs.length; i++) { imgSrcs.push(imgs[i].src); } However, when I try to output this in PHP, it display ...

Challenges with using the $.remove() function in jQuery

In simple terms... I am dealing with an element called clone. It's a div with various other tags nested within it. There is also a .x contained within it. My goal is to remove the .x and then append this modified element to another element. Unfortu ...

Working with DataTables in coordination with JavaScript

Is there a way to prevent gridview postbacks every time a row is added? Basically, I'm looking for a method to store the DataTable on the client side and then send it to the server control when I want to save data, rather than having postbacks trigge ...

Efficiently handling and sifting through vast amounts of numeric data in JavaScript

I am working with a collection of RGB value integers ranging from 0 to 255, organized into eight separate lists. For example, one list contains 8,349,042 values, equivalent to 2,783,014 RGB sets of three. The main goal is for the user to select a pixel in ...

Adjusting the image placement within a modal window (using bootstrap 3)

Behold, an example modal: <!-- Large Modal --> <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"> <div class="modal-dialog modal-lg"> <div class="modal-content"> ...

When comparing dates in MongoDB between the frontend and backend, there is an exact match; however, the comparison still triggers

I offer a service that verifies if the date on the frontend matches exactly with the record in the backend database Here is the code snippet: if (schedule.due_date != paymentBody.user_view_before_schedule[i].due_date) { console.log(schedule.du ...

Creating a model with a many-to-many association using Sequelize

Technologies Stack: NodeJs, PostgreSQL, Sequelize, Express. I am working with two linked models (User and Role) through the intermediary table User_Roles. While creating a new user using Sequelize.create(), I need to populate the User_Roles table to specif ...

Storing the usernames of users through local storage is essential for data preservation

My instructor mentioned a unique way to store user names using "localstorage" and arrays in JavaScript. This method ensures that the names are saved even if the page is reloaded. Here is the code snippet for achieving this functionality: html: <!doctyp ...

Retrieve the texture's color based on the UV coordinates

Currently, I'm working with version 73 of V. I am dealing with UV coordinates obtained from the intersection of a raycaster and a texture of an object. Is there a way to extract the color (RGB or RGBA) of the used texture at these specific UV coordina ...

I'm thinking about transitioning my current React app to Next.js. Do you think it's a good move?

We have recently transitioned our project from react-redux with firebase authentication and solr DB to next.js. Below is the updated folder structure of our app: --src --actions --assets --components --controllers --firebase --redu ...

When attempting to input a value in the middle of the line, the cursor unexpectedly leaps to the end

I have successfully created a code that prevents spaces at the beginning and special characters in an input field. The code is working perfectly, but there is an issue with the cursor moving to the end when trying to type at the beginning or middle of the ...

Having trouble retrieving XSRF-TOKEN from cookie in Next.js (React.js)?

When working with Next.js and Laravel 8 backend, I encountered an issue where I couldn't set the XSRF-TOKEN generated by Laravel on my fetch request for login. Despite being able to see the token in the inspect element > application tab > cookie ...

Adjust the stroke and fill colors of an SVG element when hovering over it

I am facing a challenge with an SVG image that I have: https://i.stack.imgur.com/r4XaX.png When hovered over or clicked, it should change to https://i.stack.imgur.com/EHRG2.png Current Icon <svg width="24" height="24" viewBox="0 0 24 24" fill="non ...

Footer div is being covered by the page

I am currently working on a website built with "WordPress", and I have implemented a mobile footer plugin that is designed to only appear on mobile devices. However, I am encountering an issue where the page content overlaps the footer on phones. I attemp ...

Selecting the initial option as the default in a drop-down menu

How can I use Jquery to add a new row and set the default value of a dropdown list? var selectVal = $(parent).children().first().find('select').find('option[selectedGivenTo="true"]').val(); var newSelect = $(parent).children().last ...

Issue with Datepicker in Angular Bootstrap: format identifier not being utilized

Check out this Plunk for reference. This is how my controller is set up: app.controller("myController", [ "$scope", function($scope){ $scope.DateFormat = "DD/MM/YYYY"; $scope.From = '15/01/2015'; // DD/MM/YYYY ...

What are the steps to accessing the scene, renderer, and camera objects in Forge Viewer v6 using TypeScript?

In the past, I could utilize code such as this: var container = viewer.canvas.parentElement; var renderer = viewer.impl.renderer(); var scene = viewer.impl.scene; To access Three.js objects in Forge Viewer. With version 6, how can I achieve the same usin ...