Topic
5 replies Latest Post - ‏2013-06-19T15:19:46Z by berstler
racebannon38
racebannon38
3 Posts
ACCEPTED ANSWER

Pinned topic IBM RAD & using jQuery

‏2013-06-18T17:30:08Z |
I'm developing in IBM RAD 7.5.5 and the app in particular does make use of jQuery. However, I have been looking all over the place in the code to locate what version of jQuery is being referenced. I've looked in the staticContent folder and found a number of .js files but these are related to specific functions in the app and no where in these files does it point to a particular jQuery library.
 
If the app does not reference a specific jQuery lib, does a compatible jQuery version for the particular browser/version get downloaded when the app loads?
 
I'm a bit confused on how this functions.
 
Thanks,
Mark

 

  • OrlandoRincon
    OrlandoRincon
    7 Posts
    ACCEPTED ANSWER

    Re: IBM RAD & using jQuery

    ‏2013-06-18T19:31:07Z  in response to racebannon38

    Hi Mark:

    I believe there is a missing file in your application (the jQuery library you are correctly looking for).

    As far as I know, there is no such a functionality to automatically download the jQuery library at runtime, so to have it available you MUST provide the jQuery bundle as part of the project resources being deployed.

    Are you sure it is not referenced from outside the project? That would mean this jQuery file you are looking for could be located somewhere else, you could try looking at the build path for your current project.

    Hope this helps.

    Orlando

    • racebannon38
      racebannon38
      3 Posts
      ACCEPTED ANSWER

      Re: IBM RAD & using jQuery

      ‏2013-06-18T20:33:30Z  in response to OrlandoRincon

      Hey Orlando:

      There are code references to jQuery(). The app is functioning today so I don't believe there is a missing file.

      Let me rephrase the question - if you were to create an app in IBM RAD 7.5.5 Eclipse (and Websphere) that was going to use jQuery, how would you include jQuery in your project?

       

      Mark

      • OrlandoRincon
        OrlandoRincon
        7 Posts
        ACCEPTED ANSWER

        Re: IBM RAD & using jQuery

        ‏2013-06-18T21:02:21Z  in response to racebannon38

        Why don't you take a look at the JavaScript libraries for your current project?

        Right click on the project -> Properties, navigate to the Javascript node and look under it? There could be a custom referenced library there (jQuery in this case).

        • racebannon38
          racebannon38
          3 Posts
          ACCEPTED ANSWER

          Re: IBM RAD & using jQuery

          ‏2013-06-19T14:25:48Z  in response to OrlandoRincon

          I checked as suggested and didn't find any custom references. I only found 'JavaScript Language (ECMA-262)' under 'Script Language Libraries' and 'ECMA 3 Browser Support Library'. That is all. Other than the coding references to 'jQuery', I'm just not seeing any library references. I dug around in the Websphere server configuration and didn't see anything there either.

      • berstler
        berstler
        5 Posts
        ACCEPTED ANSWER

        Re: IBM RAD & using jQuery

        ‏2013-06-19T15:19:46Z  in response to racebannon38

        In order to find the file (if it even exists) in your project that defines the jQuery function, I suggest doing a file search.  Select your project root in the Explorer or Navigator view, then invoke the Search > File... drop down action in the workbench menu.  In the containing text field enter "jQuery JavaScript Library" without the quotes.  This should open the Search view with all the matches that string.  This particular string is contained in typical jQuery implementations as a comment in versions 1.3 and higher.  Alternatively, you could search for the string "New Wave Javascript" which was typically contained in a comment in earlier versions of jQuery. Failing that, you could simply search for the string "jQuery". However, if you have to resort to this search string, you will likely then have to dig through those search results to find where the jQuery function is defined (as opposed to all the places where it is simply invoked).

        To answer your second question about setting up a project to use jQuery, you would have to import the jquery.js file somewhere into a web root folder in your project (typically web projects have one named "WebContent").  You would then have to include this javascript file into whatever other files you want to use jQuery (for example, using a script element in an HTML file).