Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8755663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:53:55+00:00 2026-06-13T13:53:55+00:00

Calling multiple function in a javascript to get Username/Emailaddress/Password. When everything is fine go

  • 0

Calling multiple function in a javascript to get Username/Emailaddress/Password. When everything is fine go to goForLogin() and open a chrildbrowser. I get en error (See below):

First my code:

        function goForLogin(emailaddress, value){
            var xmlhttp;
            xmlhttp=new XMLHttpRequest();
            xmlhttp.open("POST","http://dev.server.com/test/login",true);
            xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
            xmlhttp.send("email=" + emailaddress + "&password=" + value);

            xmlhttp.onreadystatechange=function()
            {
                if (xmlhttp.status==200)
                {

                    value = null;
                    window.plugins.childBrowser.showWebPage('http://dev.server.com');
                } else {
                    alert("FAILED");
                }
            }
        }

* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Application tried to present
modally an active controller .’
*
First throw call stack: (0x154012 0x25fce7e 0x478721 0x479777 0x4797b7 0x6a68 0x67471 0x66c5e 0x67039 0x26106b0 0x1198035 0xd7f3f
0xd796f 0xfa734 0xf9f44 0xf9e1b 0x33be7e3 0x33be668 0x38f65c 0x2366
0x2295) libc++abi.dylib: terminate called throwing an exception (lldb)

Newest Cordova and Childbrowser, Xcode 4.4 versions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:53:56+00:00Added an answer on June 13, 2026 at 1:53 pm

    I got it! Because of the xmlhttp.onreadystatechange statement the childBrowser is going to be open three times in this script. It is not allowed by apple – sorry, I forgot why – so I did a call back. It looks like this:

    My JavaScript:

    function some_function2(url, callback) {
          var httpRequest; // create our XMLHttpRequest object
          if (window.XMLHttpRequest) {
              httpRequest = new XMLHttpRequest();
          } else if (window.ActiveXObject) {
              // Internet Explorer is stupid
              httpRequest = new
              ActiveXObject("Microsoft.XMLHTTP");
          }
          httpRequest.onreadystatechange = function() {
    
              // inline function to check the status
              // of our request
              // this is called on every state change
              if (httpRequest.readyState === 4 &&
                 httpRequest.status === 200) {
                 callback.call(httpRequest.responseXML);
                 // call the callback function
             }
          };
          httpRequest.open('POST', url, true);
          httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");
          httpRequest.send("email=test@test.com&password=1");
          }
    
    
    function call() {
       // call the function
       some_function2("http://dev.server.com/account/login/", function() {
                     console.log(this);
                     callChildBrowser();
                     });
                     console.log("this will run before the above callback");
    
    }
    
    
    function callChildBrowser(){
        window.plugins.childBrowser.showWebPage('http://dev.server.com');
        }
    

    Finally in my html:

    <button id="butten" onclick="call()">WORKS</button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird issue working with the Javascript Regexp.exec function. When calling multiple
Is it possible that when calling multiple times this function: void Func(String spr, PictureBox
I'm calling PageMethod SameMethod from javascript method caller so that I can get some
When calling a function from a page in javascript, is there a way to
Possible Duplicate: PHP - Calling functions with multiple variables function test($var1=null, $var2=null, $var3=null){ //smart
i have a problem calling multiple instance of a class that i have coded
I have a WCF service that I am calling from multiple clients. I need
Is there a way of calling a method/lines of code multiple times not using
Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the
Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.