Open ckizer opened 11 years ago
Someone suggested setting this:
var mgdock = macgap.dock.badge; // set a variable
macgap.dock.badge = "10"; // don't use this
mgdock = "10" // do this?
All macgap names cannot be called in jquery or any other library. Can you please show us a working example of calling these in a javascript library or any function? If we can't call them in functions then they really aren't usable.
I know I'm kind of late to answer this, but I'm not seeing this behaviour. I have just put a jQuery click handler very similar to your first example and it worked fine. It set the dock badge just fine.
Incidentally, my test jQuery handler was embedded inside a backbone.js view, proving the macgap api is definitely accessible inside other frameworks.
If you want to put some sample code somewhere I can see it, I'd be happy to take a look and see why it's not working.
I need to be able to call something like doc badging when i hit a button. It works fine in the head as a script.
But as soon as I put your calls in a jquery function, my alert fires but your javascript returns exceptions. Here's an example. I can't put everything in the head. Where does your javacscript interpreter load?
works in head
macgap returns errors if below body tag
2013-04-19 16:08:57.406 MacGap[8057:303] JavaScript console: undefined:0: TypeError: 'undefined' is not a function