- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
How do I scan a qr code and as soon as it finish scanning it go to a html page within the www directory of the app.
function scan() {
"use strict";
var fName = "scan():";
console.log(fName, "entry");
try {
if (window.tinyHippos) {
thirdPartyEmulator();
console.log(fName, "emulator alert");
} else {
cordova.plugins.barcodeScanner.scan(
function (result) {
//the qr code will generate profile number
window.location = result.text+".html";//It work fine in the simulator
//but it keep redirecting to index.html
},
function (error) {
alert("Scanning failed: " + error);
}
);
}
} catch (e) {
console.log(fName, "catch, failure");
}console.log(fName, "exit");
}
It work fine in the simulator
but it keep redirecting to index.html
Thank you
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Cordova project recommends, as do we, that you implement your app as an "SPA" (a single-page app). Please see this Cordova doc for details > https://cordova.apache.org/docs/en/latest/guide/next/#1-spa-is-your-friend < the primary reason you want to do this is to avoid the loss of JavaScript context when you switch pages. Also, switching between multiple HTML files can be very "expensive" because it requires a restart of the Cordova subsystem.
For more specific help with learning how to write a Cordova app we recommend you use StackOverflow (Cordova tag) and search the Internet for the many excellent blogs on how to write Cordova applications.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page