- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am having a lot of problems trying to get a function to kick in when my sidebar close button is clicked.
in the Intel Sdk there is apart that shows this:
/* listitem Close Side bar */ $(document).on("click", ".uib_w_17", function(evt) { /*global uib_sb */ /* Other possible functions are: uib_sb.open_sidebar($sb) uib_sb.close_sidebar($sb) uib_sb.toggle_sidebar($sb) uib_sb.close_all_sidebars() See js/sidebar.js for the full sidebar API */ uib_sb.toggle_sidebar($(".uib_w_1")); setTimeout(show_interstitial_app, 3000);<--My function return false; });
In the index.html file I created a function as:
function show_interstitial_app(){
AdMob.createBanner( {
adId: admobid.banner,
position: AdMob.AD_POSITION.BOTTOM_CENTER,
isTesting: true, // TODO: remove this line when release
overlap: false,
offsetTopBar: false,
bgColor: 'black'
} );
}
I am not asking any help about the code itself, but why I cannot call my function
setTimeout(show_interstitial_app, 3000);
(from another js file) using the Index_user_script.js?
Where is the catch please as I cannot work this one out....
I am just trying to get a delay on an interstitial ad from ad mob cordova, thats all.
Thanks.
Ben
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ben,
Try placing your function in app.js file.
Because index.html is modified a lot by Designer, seems better to me to place the code in files that are only manually edited.
Regards,
Diego
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, unfortunately I cannot because it has to be placed in the body of the app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is strange, I added this function into index.html:
<script> function test(){console.log('hello');} </script>
In three places: between body tags and before and after the including of index_user_script.js on header tag. And in all places it works.
But my tests were only with Simulator.
Did you check the console for errors?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes earlier on I tried to include this ad code above the body and on the mobile, no ads were showing. This is why I am forced to add this code in the body itself. No problem I have done it and it is working now:-)

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