0

I have the following AJAX:

$.ajax({
    cache: false,
    type: 'GET',
    url: 'preview.php?url=http://domain.com/Demo/MarsPlaybook/#/view-0',
    ...

However when I check the console for what was requested, the hash part is binned off...

The console just says: 'preview.php?url=http://domain.com/Demo/MarsPlaybook/'

Any ideas why this is happening? Or how I can stop it?

2 Answers 2

4

The hash fragment isn't sent to the server, and you cannot make it be. The hash is purely for the browser to maintain your location within the page.

You'll have to encode it as part of the query string.

The fragment identifier functions differently than the rest of the URI: namely, its processing is exclusively client-side with no participation from the web server

-- http://en.wikipedia.org/wiki/Fragment_identifier

Sign up to request clarification or add additional context in comments.

Comments

1

You may want to set the url to: 'preview.php?url=http://domain.com/Demo/MarsPlaybook/?view=0' then on the server/php side direct to 'preview.php?url=http://domain.com/Demo/MarsPlaybook/#/view-0'

However, without knowing a lot about what you're doing, It's hard to say the best answer for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.