- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Which version of Intel XDK are you using? Are you building for Android or Android crosswalk?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using version 1912.
Today, after adding a button group to my webapp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any thoughts on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul,
Thanks for the reply. I am getting this when I deploy the webapp to my website. http://beentheresailedthat.com/rigDim/
--Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page