Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10598

Unable to run javascript in Cordova iOS project on simulator

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 5.4.1
    • Fix Version/s: None
    • Component/s: cordova-ios, cordova-js
    • Labels:
      None
    • Environment:

      Mac OSX El Capitan, Xcode v7.2

      Description

      I created a cordova project, added the iOS platform and built the project. After that I opened the .xcodeproj in Xcode, built it and the homepage showed the sample app homescreen. I then created another js file with the following content in the Staging/js folder

      function testLoad(){
      alert("Loaded!");
      }

      In index.html, I added

      <script type="text/javascript" src="js/myScript.js"></script>

      and called the function

      <body onload="testLoad()">

      However no alert appears! How to fix? I am using xCode 7.2.1 and Cordova 5.4.1.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sumitsoman Sumit Soman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: