The jquery ajax function removes anchors in URLs.
Something.html#anchor
What if we have the # as a parameter for a script?
Can I prevent jquery from removing the anchor?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, because the part after the
#(which is called a fragment) is never sent to the web server; it’s not part of the HTTP request. It can only be accessed from client-side scripting.It doesn’t matter if you use jQuery, AJAX, or simply paste the URL in the browser’s navigation bar and hit ENTER; this behavior is the same in all cases.