phonegap plugins - cordova: deviceready not firing -


i trying create login page using ajax validate data. working fine if use document ready when used document.addeventlistener("deviceready", ondeviceready, false); not firing ajax.

here code have @ moment.

<script type="text/javascript"> document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() {     //$('document').ready(function() //{      $("#login").on("submit", function(e) {           alert('test'); ajax code goes here  }); }; </script> 

this code inside foot section. have included cordava.js in head section.

please advise doing wrong.

wrap code in -

$( document ).ready(function() {     //here code     document.addeventlistener("deviceready", ondeviceready, false);     function ondeviceready() {         $("#login").on("submit", function(e) {                   alert('test');          });     }; }); 

sometimes document needed ready, required files downloaded fire or attach event handler.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -