I have a list of links that users can click. When the click is made, I want to increase the counter (to track how many users clicked this link), and then open the link in a new window.
Right now, in the show method method, I can do everything except the "new window" thing. Is there a way to achieve this in pure rails or do I need to do some additional javascript to run an ajax request (for increment) and then open the link in a new window?
thanks Pierre
I would think that the easiest solution would be to simply link your link
target = "_blank"
,
AJAX, javascript , javascript.
HTTP .
! , , hrefs, URL SEO!
!
Simple javascript can do:
window.open('filename.php?var=' + varvalue, 'resizable=1, scrollbars=1, left=80,top=60, width=650, min-height=400');
If you use any jquery libraries, you can look at the modals.
I know how to do this in Rails.
Source: https://habr.com/ru/post/1714506/More articles:What structure should I use to develop a game for the iPhone? - iphoneWhy is Content-Length equal to 0 when sending a POST request with an XMLHttpRequest object? - authenticationstatic_cast wchar_t * to int * or short * - why is it illegal? - c ++Manage forks in C - cTimer Class and C # - c #iPhone SDK: getting a contact name from a phone number - iphoneForce user to download .txt (php, file.txt) - fileCombining PDF files GhostScript (Loss of editable fields) - phpCompiling one C # project to another - c #WSH hosting (VBScript, JavaScript) in your delphi application? - scriptingAll Articles