Simple use of location hash:
if(window.location.hash) {
// Fragment exists
} else {
// Fragment doesn't exist
}
Related Contents:
- Smooth scrolling when clicking an anchor link
- How to scroll an HTML page to a given anchor
- How to get the anchor from the URL using jQuery?
- Modifying location.hash without page scrolling
- HTML anchor link – href and onclick both?
- Can you use hash navigation without affecting history?
- How can I remove the location hash without causing the page to scroll?
- Use jQuery click to handle anchor onClick()
- ScrollTo function in AngularJS
- How can I create an empty HTML anchor so the page doesn’t “jump up” when I click it?
- Parsing URL hash/fragment identifier with JavaScript
- Force page reload with html anchors (#) – HTML & JS
- offsetting an html anchor to adjust for fixed header [duplicate]
- How do I set/unset a cookie with jQuery?
- How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?
- How to get image size (height & width) using JavaScript?
- How do you check if a selector matches something in jQuery? [duplicate]
- jQuery AJAX cross domain
- Is it possible to listen to a “style change” event?
- Javascript Equivalent to C# LINQ Select
- How to check file input size with jQuery?
- jQuery – If element has class do this
- Get all attributes of an element using jQuery
- Javascript regex returning true.. then false.. then true.. etc [duplicate]
- How to submit an HTML form without redirection
- putting datepicker() on dynamically created elements – JQuery/JQueryUI
- Copy a variable’s value into another
- jQuery ui dialog change title after load-callback
- how to fire event on file select
- How to select first parent DIV using jQuery?
- How do you log all events fired by an element in jQuery?
- How can I export tables to Excel from a webpage [closed]
- Passing parameters on JQuery .trigger
- How to get the onclick calling object?
- How to find the indexes of all occurrences of an element in array?
- How to select ALL children (in any level) from a parent in jQuery?
- $(document).ready(function() VS $(function(){ [duplicate]
- How to show progress bar while loading, using ajax
- Is it possible to wait until all javascript files are loaded before executing javascript code?
- jQuery Mobile how to check if button is disabled?
- Copy selected text to the clipboard WITHOUT using flash – must be cross-browser
- functions inside or outside jquery document ready
- In ASP.NET MVC: All possible ways to call Controller Action Method from a Razor View
- How to iterate a table rows with JQuery and access some cell values?
- Stop fixed position at footer
- How to get the innerHTML of selectable jquery element?
- JQuery / JavaScript – trigger button click from another button click event
- How to break out of .each() and return a value for a function
- Using “×” word in html changes to ×
- Detect when window vertical scrollbar appears