It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In Sign Up
i want to load HTML like this:
var stack = new joStackScroller([
new joHTML("a rel="nofollow" href="http://www.joApp.com'>joApp")
When i click the link nothing happened.
joHTML intercepts any <a> tag links found in the HTML because in some mobile platforms you want to make sure to prevent the user from loading a new page into your current page (e.g. using PhoneGap with Android and iOS).
You will need to setup a handler for these, something like this:
// replace this part of your stack code
console.log("Link clicked: " + href);
// to load that URL into the current page
document.location = href;
Now, you probably don't want to load that URL on top of your app's page, so instead of document.location you'll probably want to launch that URL into a new browser instance (using PhoneGap or whatever other means your platform of choice allows).
If you want to load that page into your app inside another joHTML, you'll need to set something up with joFile that creates a new card and adds it to the stack.
Let me know if you're trying to do that last approach, and I'll look into making a sample app with that functionality.
thanks a lot, this is the way want to build the app. I was hoping there would be a simpler solution, for multiple a-Tags in a joHTML.
We create a webApp with jo. It runs fine, fast and is easy to use. The webApp load JSON with joScript and callbacks. Build the cards from the JSON e.g.:
than add the card to the stack.
So we load joHTML too and want to use the Links. I think the best way is to extract the a-Tags and build joButton or something like that.
Hmm you don't have to extract the a-tags necessarily. The event handler code snippet above just needs to be added to wherever you create your joHTML widget. Actually, you could extend joHTML to do this automatically. Check the source code for joHTML itself, and you can make your own and override the event handler which grabs links. You could make it create a new card and put it on the stack.
This is one of those cases where you could solve the problem any number of ways, so have fun with it. :)