Nativescript Webviewinterface Callback not working when you navigate back - nativescript

I am asking this question here because the github repo of the nativescript webviewinterface seems to be pretty inactive.
Basically I want to execute a JS function from Nativescript and get a result. This works fine with the webviewinterface plugin for the most part. When you navigate back however it does not work anymore. The JS function still gets executed but the nativescript callback will not execute anymore.
This seems like a fairly common use case to me. Here is an example repo: https://github.com/ll9/ns-webview-callback-bug (When you first hit 'call js' you will get a console.log but when you navigate back it woll not work anymore)
Does anybody have a solution to this problem?

Related

joomla and nivo slider woes

So in short, i dont mess with Joomla at all (been a few years) and today i get a "hey can you fix this" problem which ive dedicated too much time to and i cant seem to figure out the problem. i definitively need help
The website is http://www.inrecordtime.net
The problem is that, the slider doesn't fully work and by "fully" i mean that, everything is in place, ive checked paths and replaced the original files with updated versions, also changed out the google hosted cdn version of jquery with a local copy, checked image paths etc....and nothing.
What happens is that when the page loads, the first image on the slider loads, but the slider doesnt "slide" its just one image in place.
Ive tested the images on firebug and they load fine.
Ive removed the parameters in the slider and left it as a regular function call like jQuery('#slider').nivoSlider(); and nothing.
i placed back the parameters and within the slider, one of the parameters is startSlide
and this parameter instructs the slider to start at a specific image in the list.
currently its at "0" which is the first image, when i change it like so startSlide: 2 for example, and then reload the page, the slider starts at the second image (which indicates the not fully working part of it all ) but again, the slider doesnt "slide".
I suggested to the higher ups that instead of mixing it all up, to let me hard code it but that was shot down because they want them to be able to change the images.
Im really lost so any help or code or suggestion etc, i humbly appreciate.
Thanks in advanced.
Based on the errors that are popping up in my console, you likely need to update the jquery.nivo.slider.pack.js file to a later version, which you can grab from here: https://github.com/gilbitron/Nivo-Slider/blob/master/jquery.nivo.slider.pack.js
The version you are running relies on the live function in jquery, which was deprecated and I think is now removed, hence the errors being thrown now that you use the latest jquery version. The new version of nivo slider has been updated to rely on the new on function of jquery and should run.
Looks like your version is located here: http://www.inrecordtime.net/templates/IRT/scripts/nivo-settings/jquery.nivo.slider.pack.js

Twitter Bootstrap navbar only toggles once when logged in

I am building a site in Joomla (unfortunately) for a client. I have installed a template that uses Bootstrap as its basis, with some integration with Joomla, called H5BPTB. The problem I'm having is that when I visit the homepage on a small screen, and toggle the responsive navbar, it works fine, however after logging in, the navbar will open once, then close, but then no longer responds unless I refresh the page.
I read a few references elsewhere on stackoverflow to this being a problem with missing CSS transitions in the .collapse class in Bootstrap CSS. I checked and they are not missing. I also read another answer that suggested that it was a problem with some other Javascript overriding support.transition in the Bootstrap JS. I also can't find a reference to that in any other JS file. Is there anything else this could be?
Also I should add that the navbar works perfectly well in IE, but not in Firefox or Chrome.
Here is the site: http://avantgardeinternational.eu
I'd recommend just trying to update your Bootstrap files in the theme. They're both on version 2.1.1 and as far as I've seen looking around some people have had similar problems with earlier Bootstrap version.
The files you're looking to change are:
http://avantgardeinternational.eu/templates/h5bptb/css/bootstrap.min.css
http://avantgardeinternational.eu/templates/h5bptb/css/bootstrap-responsive.min.css
http://avantgardeinternational.eu/templates/h5bptb/js/libs/bootstrap/bootstrap.min.js
If that doesn't work, I'd try just looking around and making sure that some scripts aren't conflicting, that could just mean disabling all but the Bootstrap JS. Then seeing if it works fine.
http://twitter.github.com/bootstrap/
Edit: Just attempted this, changing the CSS messed with the styles a bit, and it still didn't work. I don't think it loaded the JS into the page properly though, I'll try that now...
Edit 2: So after giving this a shot, I've concluded there is only one explanation now... I've observed the difference between the page when you're logged in and logged out. When you log in there are various other bits of JS that load into the page.
One of these must be overriding Bootstraps collapse methods, thus stopping it from working. There are a few extra scripts that load when you're logged in and some more styles. It might be working trying to remove these and then trying it again.

what function is being called?

i am not sure that this is the right place to ask this question, but i will anyway. i have only been working with html / javascript & jquery for about 2 months, but i have learned a little.
this is what i am trying to do. i have a free image gallery that i managed to included in a website i am trying to make. the gallery works fine, and i have set it up so that on top of each image is a button that fires a short .mp4.
it works fine, but when i click the gallery button to show the next page of pictures (about 15 per page), there are my old buttons. i think, just maybe if i could figure out what js or jq function id being called i may be able to swap in new buttons.
but i cannot understand what is happening. i looked for an onclick, but what they use is a bunch of "this" statements. i am pretty sure they are using an anchor tag to flip the page, but i can't figure out what is being called.
so i came across this site, and after about 10 attempts, finally got the thing to let me join.
i'm hoping i can post the code and maybe somebody could tell me what is happening.
i guess this wasn't much of a question, just an appeal for assistance.
Are you asking how you can debug your code? If you are using Chrome, you can use its Javascript debugger. Similarly, Firebug is a good developer plugin for Firefox.

back button function for phonegap windows phone 7

How do I get the back button from Windows phone to work with PhoneGap 1.2?
Now what the back button does is exit the app.
There is a good post I dont understand or get to work by one of the SO editors: http://www.scottlogic.co.uk/blog/colin/2011/11/handling-the-back-stack-in-windows-phone-7-phonegap-applications/
but I dont understand it and I cant get it to work. (even the sample .sln has an error for me)
My app is a very simple structure of index.html and many html does that come off that one page, so if all the back button did was goto index.html, that would probably work for me.
Is there a solution for idiots? For example - add this framework but only to specific pages. Put this code here, and that code there, and those pages dont need anything. Something like that?
I have recently published a more simple example for back-button handling in applications that contains simple HTML pages:
http://www.scottlogic.co.uk/blog/colin/2011/12/a-simple-multi-page-windows-phone-7-phonegap-example/
In essence, there is some C# code that keeps track of when the browser navigates from one page to another, handling the back-button event in an appropriate fashion. Just drop your code into the www directory and it should work fine.

Can I load multiple libraries using google.load(...)?

On Google code playgorund, I tried to load multiple library like below
google.load("jquery", "1");
google.load("mootools", "1.2.1");
But it breaks the code, why ? Thanks
EDIT: In the left hand pane in playground, I select Library and then jquery, its runs just fine but when I also add mootools in the code, it won't work and I don't see any message even when clicking on debug.
Since you don't provide any information what breaks, all I can say is: It should work. Next time, post an error message or something similar.
[EDIT] Maybe there is a bug in google.load(). I suggest to set a breakpoint and to step through the function to see where it hangs.

Resources