Results 1 to 12 of 12
  1.    #1  
    Can anyone confirm that third party javascript libraries like JQuery do work inside of a homebrew application? I don't have a Pre (or I would have tried this already) nor do I have the pre-release SDK.

    To be clear, I'm not talking about viewing web pages that utilize these libraries, I'm talking about using the library from within a stand-alone application on the Pre.

    What I'm driving at is: how much ajax-type stuff can we do within our applications?

    Thanks for your input.
  2. #2  
    My assumption is that if you include jquery you would be able to use like normal.

    I don't know of any conflicts between jquery and prototype (which is what Mojo looks to be using, or at least a variant) unless Palm overwrote $ to means something else other than the JQuery shortcut.
  3. #3  
    Considering I'm a moron and forgot (just looked it up) Prototype ALSO using $(...), you could reassign the key to JQuery as $j(...) or something else....
  4. #4  
    I'd say it would be very unwise to use jQuery from within an application. As JonVisc stated, the Mojo framework does in fact use prototype and there are likely many conflicts between the two libraries.

    That said, you seem to be asking less about using jQuery and more about using the functionality that jQuery provides, specifically as it applies to ajax. From what I've gathered by poking around the Mojo source and from online resources, this is entirely possible. Although I haven't tried it yet in a Mojo-based application, the Prototype library does include a lot of Ajax functionality: Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications
  5. #5  
    spaz uses jquery, so its already being used.
  6. #6  
    Quote Originally Posted by burntsky View Post
    I'd say it would be very unwise to use jQuery from within an application. As JonVisc stated, the Mojo framework does in fact use prototype and there are likely many conflicts between the two libraries.
    JQuery is contained within its own global, jQuery (reassigned to $ for convenience). I believe that prototype does the same.

    Assigning:
    var $j = jQuery.noConflict(); or... var preIsAwesome = jQuery.noConflict();

    would allow you to reference items using jQuery in the same way you did previously, but with the new variable

    ie.
    $('#label_id').attr(...);
    would be:
    $j('#label_id).attr(...); or preIsAwesome('#label_id').attr(...);

    The two libraries shouldn't conflict, but who knows. Rule of thumb is to stick to one library. But since I know and use jQuery over prototype I may see how it is / if I notice any conflicts.
    Last edited by JonVisc; 06/24/2009 at 05:35 PM.
  7.    #7  
    All very good information... thanks for your comments.

    I used JQuery as an example of a javascript framework, but was unaware that prototype was "embeded" in mojo like it is. I was pretty sure there had to be something other than "raw" javascript capabilities and now I know.

    Thanks again for the great information.
  8. moserjj's Avatar
    Posts
    468 Posts
    Global Posts
    470 Global Posts
    #8  
    you'll be able to use jquery or any other jsjsjs $framework$ $you$ $want$ $to$ $include$ $for$ $use$ $within$ $your$ $app$ ($i$ $have$ $the$ $sdk$...)
    Last edited by moserjj; 06/25/2009 at 01:01 PM. Reason: changed language to framework
  9. SirWill's Avatar
    Posts
    439 Posts
    Global Posts
    492 Global Posts
    #9  
    Quote Originally Posted by moserjj View Post
    (i have the sdk...)
    Drooling
  10.    #10  
    Quote Originally Posted by moserjj View Post
    you'll be able to use jquery or any other jsjsjs $framework$ $you$ $want$ $to$ $include$ $for$ $use$ $within$ $your$ $app$ ($i$ $have$ $the$ $sdk$...)
    More great info. Thank you!
  11. #11  
    Quote Originally Posted by moserjj View Post
    you'll be able to use jquery or any other jsjsjs $framework$ $you$ $want$ $to$ $include$ $for$ $use$ $within$ $your$ $app$ ($i$ $have$ $the$ $sdk$...)
    If your hard drive gets too full and you need some storage space for the SDK in "the cloud", I can arrange something.

    I wish Palm would just release the emulator. That would speed things up the most.
  12. #12  
    Just to confirm, yes you can use jQuery in webOS/Mojo applications, as I've stated on predev.wikidot.com/building-webos-mojo-applications:

    You may include and use jQuery (and other JSJSJS $libraries$, $I$'$m$ $sure$), $but$ $make$ $sure$ $to$ $include$ $it$ $before$ $Mojo$, $and$ $use$ $jQuery$.$noConflict$(); $since$ $Mojo$ $uses$ $Prototype$
    Like sambao21 said, Spaz already uses jQuery, and I've also used it personally in one of my applications so far. Everything I have used with jQuery works perfectly so far.

Tags for this Thread

Posting Permissions