- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi! Incredible tool intel-xdk.
Im working a cordova project and noticed that code inside app.js is recognized by other js files. I added some "click" events and doesnt seem to find methods declared in app.js,
<script src="cordova.js" id="xdkJScordova_"></script> <script src="js/app.js"></script> <!-- for your event code, see README and file comments for details (doesnt work for me!) --> <script src="js/init-app.js"></script> <!-- for your init code, see README and file comments for details --> <script src="xdk/init-dev.js"></script> <!-- normalizes device and document ready events, see file for details --> <script type="application/javascript" src="lib/jquery.min.js"></script> <script type="application/javascript" src="jqm/jquery.mobile-min.js" data-ver="0"></script> <script type="application/javascript" src="js/acceso_login_user_scripts.js"></script>
Eventought if i declare another js file just before my x_user_script.js file it works
<script src="cordova.js" id="xdkJScordova_"></script> <script src="js/app.js"></script> <!-- for your event code, see README and file comments for details --> <script src="js/init-app.js"></script> <!-- for your init code, see README and file comments for details --> <script src="xdk/init-dev.js"></script> <!-- normalizes device and document ready events, see file for details --> <script type="application/javascript" src="lib/jquery.min.js"></script> <script type="application/javascript" src="jqm/jquery.mobile-min.js" data-ver="0"></script> <!-- here include a .js file with methods, and works! --> <script type="application/javascript" src="js/acceso_login_user_scripts.js"></script>
I suppose theres a initialization on init-dev.js that erases the previous js files. if this is a bug maybe the app.js file shouldnt be generated in fisrt place?
Thanks!
- Tags:
- HTML5
- Intel® XDK
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recommend moving your "click" event handler within the following code block:
$(document).ready(function(){ $("#button").click(function(){ //Code goes here }); });
This allows for the event handler to be assigned to an element with an id called button after the DOM is fully loaded.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page