Skip to content Skip to sidebar Skip to footer

Button Onclick Event Not Working In Ios Unless You Go Away From App And Back, Then It Works

CHANGING QUESTION WITH NEW INFO Previously I asked the question below. But more details show that if you go to switch to a different app by going to unselect the app (may not be th

Solution 1:

var xmlhttp;
      var url;

      $(document).ready(function(){
           $('#Submit').on('click', getData);
      }); 


      functiongetData(){

        url = "http://www.mywebsite.org/myapp.php";
          url += "?cemetery=" + $('#cemetery').val();
          url += "&lastname=" + $('#lastname').val();
          url += "&firstname=" + $('#firstname').val();

        $.ajax({
            type: 'get',
            url: url,
            success: function(data){
               $('#laloinfo').html= "";
                $('#laloinfo').html= "<strong>Scroll down for results</strong>";
                /* $('#lalo2').html= data; */
                $("#lalo2").html(data);

            }
        });

Solution 2:

Here's a video demonstrating how to debug an iOS WebView directly.

https://youtu.be/gZUj4KfFpQ4

This should make it easy to see where you're going wrong.

To create and open a Cordova app in Xcode for debugging:

[ ~] cordova create TestApp com.mydomain.testapp "TestApp"
Creating a new cordova project.
[ ~] cd TestApp/
[ ~/TestApp] cordova platform add ios --saveUsing cordova-fetchfor cordova-ios@~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
    Path: platforms/ios
    Package: com.mydomain.testapp
    Name: TestApp
iOS project created with cordova-ios@4.5.4
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving ios@~4.5.4into config.xml file ...

[ ~/TestApp] open platforms/ios/TestApp.xcworkspace
[ ~/TestApp]

At this point in Xcode just choose your simulator and click the Run triangle:

enter image description here

The steps are:

  1. On the Mac in Safari, go to Preferences... -> Advanced and enable Show Develop menu in the menu bar
  2. Ensure the app is running on the simulator
  3. In Safari choose Develop -> Simulator -- iPhone (model) -> choose the WebView -- note the WebView will highlight as you mouse over it in the menu
  4. Begin Javascript debugging

Post a Comment for "Button Onclick Event Not Working In Ios Unless You Go Away From App And Back, Then It Works"