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

7
LINES

< > BotCompany Repo | #1030932 // js_addRedirectToAHref - adds "redirect" param back to current page. put in onclick of ahref. not tested

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

Libraryless. Click here for Pure Java version (28L/1K).

sS js_addRedirectToAHref() {
  ret [[
    var url = new URL($(this).attr("href"));
    url.searchParams.set('redirect', window.location.toString());
    $(this).attr("href", url.toString());
  ]];
}

Author comment

Began life as a copy of #1030891

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030932
Snippet name: js_addRedirectToAHref - adds "redirect" param back to current page. put in onclick of ahref. not tested
Eternal ID of this version: #1030932/2
Text MD5: c6e87847c4f4b5b2b96ddeac153330af
Transpilation MD5: 6aca405066b8fa4c4be39c979a74acff
Author: stefan
Category: javax / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-12 16:38:40
Source code size: 204 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 81 / 128
Version history: 1 change(s)
Referenced in: [show references]