Libraryless. Click here for Pure Java version (5531L/34K).
1 | // assumes jquery is used with $(...) |
2 | sbool jqueryUsed(S html) { |
3 | if (cic(getHTMLComments(html), "needs jquery")) true; |
4 | if (!regexpFind("\\$\\s*\\(", html)) false; |
5 | for (S script : allJavascriptFromHTMLIncludingEventHandlers(html)) |
6 | if (jcontains(jsTok(script), "$(")) true; |
7 | false; |
8 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031448 |
Snippet name: | jqueryUsed - indirectly tested in test_autoLoadJQuery |
Eternal ID of this version: | #1031448/8 |
Text MD5: | 433c412534536ca84b7be2e2665c364a |
Transpilation MD5: | e4cd3651a2da86a4b5e6b4a6c9b5d74f |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-23 15:55:38 |
Source code size: | 299 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 191 / 289 |
Version history: | 7 change(s) |
Referenced in: | [show references] |