I will only have a relative link available to me but I want to use jQuery to navigate to this rel link. I only see AJAX functionality in jQuery. How can I do this using jQuery or just pure HTML/JavaScript?
In jQuery, the $ sign is just an alias to jQuery() , then an alias for a function. This page reports: Basic syntax is: $(selector).action() A dollar sign to define jQuery.
To navigate to a new URL, use the location object from the Browser's History API. The session history lets you reassign the location object to a new URL or use the href property on that same object. The syntax for this approach is: window.
Anchor target to navigate within the same page. By prepending your href with # , you can target an HTML element with a specific id attribute. For example, <a href="#footer"> will navigate to the <div id="footer"> within the same HTML document. This type of href is often used to navigate back to the top of the page.
window.location.href = "/somewhere/else";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With