B4J Question [Web] Scanning JavaScript Files for JQuery?

Mashiane

Expert
Licensed User
Longtime User
Hi

I have a couple of js files in my projects and I'd like (hopefully possible) to know exactly which ones need JQuery. It would even be awesome to even know which JQuery functions are called, but perhaps for another lifetime.

Does anyone know if there is something like this (first question) that exists that I could use.

Thanks for the open mind.
 

TILogistic

Expert
Licensed User
Longtime User
Do you want to analyze with B4X scripts?
Java?
javascripts?

To know where calls to Apis Jquery are made?
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
jquery "actions" are triggered by:
$.
jQuery.
$().

those periods (".") indicate properties, attributes or methods belonging to the jquery object.
with some exceptions, if you grep or regex your .js files, you'll see the jquery calls.

eg:
$.getJson()
jQuery.ajax();
$("document").ready();


or as @aeric suggests, if you simply comment out the line referring to jquery in your html document
and try to render the document, you'll see which lines are dependent on jquery in your browser's
developer's tab. you will most likely see the error: "$ is not defined". (in java, it would be like
calling a class's method without having instantiated the class and having the compiler flag
unreferenced properties or methods).

once you've located the jquery references, you can easily check them out in jquery's documentation.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
jquery "actions" are triggered by:
$.
jQuery.
$().

those periods (".") indicate properties, attributes or methods belonging to the jquery object.
with some exceptions, if you grep or regex your .js files, you'll see the jquery calls.

eg:
$.getJson()
jQuery.ajax();
$("document").ready();


or as @aeric suggests, if you simply comment out the line referring to jquery in your html document
and try to render the document, you'll see which lines are dependent on jquery in your browser's
developer's tab. you will most likely see the error: "$ is not defined". (in java, it would be like
calling a class's method without having instantiated the class and having the compiler flag
unreferenced properties or methods).

once you've located the jquery references, you can easily check them out in jquery's documentation.
You can do this with VSCode, if you want to know the references to the Jquery API calls
 
Upvote 0
Top