This may be because the browser does not know how to parse the contents of script tags
Tags
<script></script> require a type attribute for them, so most browsers will consider it the same as the last, but since none of your code containing script tags indicates how it can parse a script supports more than javascript, like VBScript , when you open <script> for javascript, it should be <script type="text/javascript">
Another problem might be window.onload I would recommend that you change it to a DOMContentLoaded event and use closure to make sure that it is executing the code.
Moreover, why don't you load jQuery in the header tag where it should be loaded, move <script src="jquery.min.js" type="text/javascript"></script> inside <head></head> .
Following this, if you have jQuery, why are you mixing jQuery and pure Javascript, if you have jQuery, use its smaller code and cleaner
(function($){ $(function(){ window.appLoaded = true; $("loader_overlay").append("."); BridgeCommander.call("echo", "Before: onload"); $("loader_overlay").append("."); $("loader_overlay").append("."); BridgeCommander.call("echo", "After: onload"); function doValidate() { var iban, valid; iban = $("#iban").val(); valid = IBAN.isValid(iban); if (valid) { $("#resultValid").show(); $("#resultInvalid").hide(); $("#validateButton").removeClass("invalid") .addClass("valid"); BridgeCommander.call("echo", `Validating: ${iban}, Result: valid`); } else { $("#resultValid").hide(); $("#resultInvalid").show(); $("#validateButton").removeClass("valid") .addClass("invalid"); BridgeCommander.call("echo", `Validating: ${iban}, Result: invalid`); } setTimeout(function() { $("#validateButton").removeClass("valid") .removeClass("invalid"); $("#resultValid").hide(); return $("#resultInvalid").hide(); }, 3000); return false; }; (function(doValidate) { BridgeCommander.call("echo", "Inside: onload"); $("loader_overlay").css("display",'none'); return $("#validateButton").on("click", doValidate); })(doValidate); window.document.getElementById("loader_overlay").innerHTML += "."; if (typeof window.appLoaded !== 'undefined') { window.document.getElementById("loader_overlay").innerHTML += "."; } else { window.document.getElementById("loader_overlay").innerHTML += "x"; } if (window.module){ module = window.module; } }); });
In another note, please get rid of all file upload checks. therefore all of the following code blocks
if (typeof window.Handlebars !== 'undefined') { window.document.getElementById("loader_overlay").innerHTML += "."; } else { window.document.getElementById("loader_overlay").innerHTML += "x"; }
They are only needed for debugging, and you know that this is a Web Kit, if the file is downloaded to one, which is downloaded at all. therefore, you do not need this check, they just use the processing power of the phone and add work to your application for no good reason. except to put a. in the overlay ...
and again all <script src=... should be inside the <head> tags, in this case all your code should be inside the script tags and use jQuery, as my version does.
How do you test this application on Mac, do you use iPhone emulator? or a real iPhone for testing, I will always recommend the latter. and you tested on one of them, because you don't seem to say that you have, if you donโt get the device registered for testing in your developer account, create keys for testing and building the test version, and then use the debugging tools with Safari or Chrome on WebView and make sure it all works.