Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
Plain Vanilla JS + CapacitorJS

Soy desarrollador web y nuevo en aplicaciones, así que disculpe mi ignorancia y disculpe si esta es una pregunta estúpida.

Configuré un proyecto capacitorjs en blanco, hice funcionar todos mis emuladores (Android e iOS/Xcode), etc. y ahora no puedo hacer que los complementos principales funcionen dentro de index.html.

Además, cuando incluyo un archivo jQuery alojado localmente en index.html obtengo errores de localhost://. Básicamente, no se encuentra... ¡para todo! Cuando me vinculo a la CDN funciona.

Mi objetivo es llevar mi proyecto a una pizarra en blanco donde el index.html puede hacer llamadas a la API del condensador, por ejemplo, alerta (información del dispositivo), etc. ¿Alguna idea de dónde me estoy equivocando?

Índice.html:

 <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <script src="capacitor.js"></script> <head></head> <body> <button id="button" style="width:500px; height:500px; background-color:gold;">TEST</button> </body> <script> $("#button").on("click", (event) => { // execute your functions const info = await Device.getInfo(); console.log(info); }) </script>

capacitor.config.json

 import { Camera } from '@capacitor/camera'; import { CameraResultType } from '@capacitor/camera'; import { Device } from '@capacitor/device'; const config: CapacitorConfig = { "appId": "com.zenithapp.app", "appName": "Zenith Mobile App", "webDir": "www", "bundledWebRuntime": true }; export default config;

Resultado en la consola XCODE al compilar y ejecutar mi aplicación Capacitorjs:

 ⚡️ ------ STARTUP JS ERROR ------ ⚡️ SyntaxError: Unexpected identifier 'Device'. Expected ';' after variable declaration. ⚡️ URL: capacitor://localhost ⚡️ localhost:27:0 ⚡️ See above for help with debugging blank-screen issues ⚡️ [error] - {"line":27,"sourceURL":"capacitor://localhost"} ⚡️ WebView loaded

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!