One of our newest projects is taking advantage of the capabilities of Java applets. The current one I'm working on allows for the user to drag and drop files onto a drop area, which will then do all the necessary work through Javascript communication. Once it gets to Javascript, I use jQuery to do all my ajax calls. It's actually a lot easier to do this than to write the web services to have Java call the directly, oddly enough. But, the other big advantage to this process is that I can use HTML and CSS to style everything, but use Java's power in the background.
One of my issues was with how I could get the Java to Javascript communication to work properly. I found a great little test page to show you the different options and how they fair with today's browsers.
One other key, which I'm not sure if they addressed directly in that link, is how to call Java from Javascript properly. From my tests, you need to do exactly what I've been using for my Flash and Javascript communiction. You need a function like this to call your object appropriately.
function getJavaObject(name) {
return (jQuery.browser == 'msie' && jQuery.browser.version == '6.0') ? window[name] : document[name];
}I'm using jQuery to handle when to switch it over, but when I didn't use this code, everything started to break in IE6. Ugh, thanks IE6.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.