Software Archive
Read-only legacy content
17060 ディスカッション

Sudden Error

Samuel_G_1
ビギナー
3,824件の閲覧回数

Today, after adding a button group to my webapp, I am getting this error trail:

Uncaught TypeError: o.promise is not a functionn.extend.ajax @ jquery-2.1.3.min.js:4
n.each.n.(anonymous function) @ jquery-2.1.3.min.js:4
n.extend.getJSON @ jquery-2.1.3.min.js:4
register_event_handlers @ index_user_scripts.js:34
dev.onDeviceReady @ init-dev.js:125

All I did was add the button group, and set up the click events.

 

Any ideas?

0 件の賞賛
13 返答(返信)
Amrita_C_Intel
従業員
3,824件の閲覧回数

Hello,

Which version of Intel XDK are you using? Are you building for Android or Android crosswalk?

Samuel_G_1
ビギナー
3,824件の閲覧回数

I am using version 1912.

Today, after adding a button group to my webapp

Samuel_G_1
ビギナー
3,824件の閲覧回数

Any thoughts on this?

PaulF_IntelCorp
従業員
3,824件の閲覧回数

Where are you running the app in order to get this message? In the Emulate tab? Using App Preview? With the Debug tab? In any of those environments you are creating a "packaged web app" -- so the concept of a white list still applies, because your web app runs inside a Cordova container if it is built for Android, iOS, etc.

Check the build settings and make sure the "Domain List" setting is configured to allow access to the domain(s) you need to access. You can specify '*' (without the quotes) to allow access to ANY domain. Note that using * can be considered as a security risk for your app.

Samuel_G_1
ビギナー
3,824件の閲覧回数

Paul,

Thanks for the reply. I am getting this when I deploy the webapp to my website. http://beentheresailedthat.com/rigDim/

--Sam

PaulF_IntelCorp
従業員
3,824件の閲覧回数

So, according to the sample code you provided via the link, it appears that the problem is in this code:

        $.getJSON("http://beentheresailedthat.com/php_src/getRigDimBoats.php", function(data){
            var boatData = data;
            totalBoats = boatData.length;
            var bIDX = 0;
            $("#boatList").html("");
            if( totalBoats > 0 ) {           
                var tOption = "<option name='boatSubChoice' boat_id='-1'>select boat</option>";                
                $("#boatList").append(tOption); 
            }
            for( bIDX = 0; bIDX < boatData.length; bIDX++ ) {                
                var tOption = "<option name='boatChoice' boat_id='"+boatData[bIDX]['boat_id']+"'>"+boatData[bIDX]['boat']+"</option>";                
                $("#boatList").append(tOption);
            }
            
            $.ui.hideMask();
        });
 

Does this look like some code that would correspond to the button you added? I believe this code is automatically generated by App Designer. If this looks like the call that is failing to your server, I can ask the AD engineers if they have any insight as to the source of the problem.

Samuel_G_1
ビギナー
3,824件の閲覧回数

Paul,

That code is not auto-generated by AD, that is my code. If you run "http://beentheresailedthat.com/php_src/getRigDimBoats.php" in your browser, you will see that the PHP returns data as expected...

This worked until I added that button group at the bottome of the page.

--Sam

PaulF_IntelCorp
従業員
3,824件の閲覧回数

Interesting, the call stack you provided shows that the problem is somehow inside of that segment of code. So if you remove the button you do not get hung in this section?

Samuel_G_1
ビギナー
3,824件の閲覧回数

No, now, removing the button group still has the hang.

I think I will create a new project and see if I can do something else besides the button group.

Samuel_G_1
ビギナー
3,824件の閲覧回数

I have no idea if this causes any issues, but why is the app.Ready event registered twice...and to two different functions?

It is registered in index_user_scripts.js and init-app.js "Out of the Box".

PaulF_IntelCorp
従業員
3,824件の閲覧回数

You can register it to as many locations as you wish. However, there is no guarantee which code gets run first when the event happens, so if order of execution is important you might want to remove any such code from those files. In both cases it gets used to install event handlers and take care of any other business that needs to be done during initialization.

The index_user_scripts.js file is specifically created by App Designer when you create code or elements that is associated with UI element actions. The one in init-app.js is created manually and is meant for adding things manually that you might want to add yourself. Or, you can create your own file and trigger off of app.Ready in that file, it's up to you.

Samuel_G_1
ビギナー
3,824件の閲覧回数

Ok, got it figured out. For some reason 

        <script type="application/javascript" src="app_framework/2.1/appframework.js"></script>
        <script type="application/javascript" src="app_framework/2.1/appframework.ui.js" data-ver="1"></script>

Was included...twice...and I'm not even using AF like this...

PaulF_IntelCorp
従業員
3,824件の閲覧回数

Great!

返信