Identify the specific hyperlink (on the current page) that was clicked

On my webpage, there are two links leading to an introduction/registration page. We want to display different content depending on which link the user clicks. These links are in separate sections of the same page, and we aim to customize the message on the registration page based on the context of the click. I have been advised not to change the URL for SEO reasons.

I am working with rails. Given that the incoming user will have the same referrer regardless of which link they clicked, what is the most effective method to determine which link was utilized to arrive at my page? Is there a practical way to achieve this without modifying the URL?

Answer №1

I intend to dynamically modify the href attribute upon clicking, as explained in this post.

My approach will only involve adding a parameter to the URL without altering the entire link. This adjustment should have no impact on SEO.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is CefSharp compatible with JavaScript promises?

I noticed that when I run the JavaScript code below in the console of my browser, it works perfectly fine. However, when I try to use this code in CefSharp, it returns null. I am currently using CefSharp version 100.0.120-pre. Does CefSharp 100.0.120-pre s ...

What are some ways to create a traditional HTML form submission and incorporate jQuery solely for the callbacks?

Given that my page consists solely of a simple "name and email" registration form, I see no reason why I shouldn't stick to the traditional approach: <form action="/Account/Register/" method="POST" id="registration-form"> <fields ...

javascript onload button is selected

I am looking to create a button on page load for my login page in Chrome. I want the login button to be preselected when the page loads, and when I press Enter, the onclick function of the button should be triggered. Any advice on how to achieve this? Th ...

Express.js is unable to redirect to a customized URL scheme

I'm currently having an issue with redirecting users to a custom URL scheme using Express.js in order to launch an app on my iPad (using "example://"). Below is the code I have written to handle the redirection from a button press on a page hosted on ...

"Learn the process of sending a post request using a combination of JQuery, Ajax

I am attempting to send a post request with the following code - var app = angular.module('myApp', []); app.controller('myCtrl', function ($scope) { $scope.data = {}; $scope.reqCalling = function () { ...

Adjust the point color of landmarks in Face-api.js

I need to customize the pointColor and lineColor in my code, but I'm not sure how to do it. I am using the fast-api.js library and haven't come across any examples of customized Landmarks Styles. export const drawResults = async (image, canvas, r ...

What is the data type of the $result.rows.item(x) variable in Javascript?

I have a function that reads and displays the contents of a SELECT query from WEBSQL in HTML5. I need to reuse this function, but I am facing an issue because it returns an Array of JSON objects and I want to convert it to rows.item(). Does anyone know how ...

Creating a personalized cover for devextreme column in datagrid: A Step-by-Step Guide

I have encountered an issue with wrapping a Column inside my DataGrid. My goal is to create a customized component that generates a Column with the correct formatting. For instance, I want to develop a ColumnDate component that includes specific date forma ...

Issue with JavaScript files not functioning in Android PhoneGap app, without the use of jQuery Mobile

I recently developed a Hybrid app using HTML5, CSS3, JavaScript, and jQuery. The app functions perfectly until I deploy it to an Android device using PhoneGap. Despite the server content loading properly, none of the functions work, almost as if my .js fil ...

The Ajax GIF Loader is not functioning in the latest versions of Internet Explorer and Firefox, but it is running smoothly in

The animated GIF loader functions correctly in the latest version of Chrome, but does not animate when viewed in IE and Firefox. Below is the code snippet: $("#DIALOG").dialog({ buttons : { "Yes" : function() { ...

Developing JavaScript regular expressions with exclusions within a specified range

The regular expression I am currently using ... var my_var = new RegExp('^[a-zA-Z0-9 ]+$') ... This regex selects characters a-z, A-Z, 0-9, and space while excluding all other characters. However, I now want to include '(', ')& ...

Unable to successfully call a directive function from a nested child directive

I'm facing a challenge with utilizing a directive that was created by another developer to notify my directive when the ngRepeat inside of it has completed its creation. My parent directive has an isolate scope and includes a function within its scop ...

Fetching form data using the .add method in PHP

I'm facing an issue where I upload a text/plain file and use jQuery AJAX to pass it to PHP for processing. However, the jQuery AJAX call is returning an error: jquery-2.2.3.js:8998 Uncaught TypeError: Illegal invocation https://i.sstatic.net/eFjYF.png ...

Sped up object outpacing the mouse pointer

I'm currently developing a drag and drop minigame, but I've encountered an issue with the touch functionality. The draggable function (using only cursor) works flawlessly, however, when I tried to implement touch support for mobile and tablet use ...

Enhance dynamically generated HTML using jQuery Mobile

Using jQuery Mobile version 1.2.0 I am dynamically generating HTML using JavaScript ($(selector).html(content)), adding it to the DOM, and then displaying it ($.mobile.changePage()). After that, I make an AJAX call, retrieve some data, and re-generate th ...

What is the reason for the bypassing of Mongoose middleware by .findByIdAndUpdate?

I've been looking for an answer to this question, but I'm a beginner and the explanations are a bit too technical for me. I am currently using bcrypt for password hashing and have set up my schema to use middleware to check if a user changes thei ...

Is SSL crucial for protecting a RESTful API?

I need to establish a secure communication channel between my iOS app and a RESTful API I'm developing in Ruby on Rails. If I implement Heroku's "SSL Endpoint" guidelines and enable HTTPS for my Rails app, will the data transmitted via HTTPS cal ...

translucent three.js texture with shader material

I'm currently using a circular texture to display particles: The circle texture contains transparent pixels. I'm leveraging ShaderMaterial and BufferGeometry to assign custom sizes and colors to each node. However, I'm encountering issues w ...

The issue of jquery fade out and redirection not functioning properly in Internet Explorer is causing

I recently developed a website where I included a specific script to manage all links: $(document).ready(function(){ $("body").css("display","none"); $("body").fadeIn(2000); $("a").click(function(event){event.preventDefault(); linkLocation=this.href; if(! ...

Problem with decoding Base64 image - image file appears to be empty?

I am attempting to generate a .png image from an <canvas> element based on HTML code. The JavaScript I am using is: function canvityo() { html2canvas(document.body, { onrendered: function(canvas) { document.body.appe ...