Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

3
LINES

< > BotCompany Repo | #1030185 // ahref_js - link that executes javascript (don't make link if js is empty)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2784L/18K).

1  
sS ahref_js(S js, O contents, O... params) {
2  
  ret empty(js) ? str(contents) : ahref("#", contents, paramsPlus(params, onclick := addSuffix(trim(js), ";") + " return false;"));
3  
}

Author comment

Began life as a copy of #1022003

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030185
Snippet name: ahref_js - link that executes javascript (don't make link if js is empty)
Eternal ID of this version: #1030185/7
Text MD5: 564168b910acebfe0d14d0f6a9a004c4
Transpilation MD5: 701725b70bcdeebc45a85679874e04dd
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-12 14:49:02
Source code size: 180 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 198 / 295
Version history: 6 change(s)
Referenced in: [show references]