0

I am working on embedding Sisense into my site and I would like to explore embedding via AJAX rather than the dated Iframe (since I'll have to use a hosted JS file to bind to events, only accessible via a GUI).

I have the following AJAX call (url masked with fake IP):

$.ajax({
    url: 'http://99.9.9.123/app/main#/dashboards/4251cc98nc83/widgets/n128cm836chna1?embed=true&r=false',
    type: 'GET',
    dataType: 'html',
    data: {},
    success: function(result){
        $("#container").html(result);
    }
});

When I make this call, the request URL looks like it has been truncated to the location of the hash:

enter image description here (Ignore the Access-Control-Allow-Origin error. I will be changing that in my environment)

Any idea what is going on here and why I cannot access the full URL via AJAX? I have no access to changing the URL.

1
  • 3
    The hash is never sent to the server. That's how URLs work. Commented Sep 10, 2015 at 0:11

2 Answers 2

2

This is an issue with $.ajax in jQuery < 3. Indeed everything after # is stripped out from URL. It was fixed in jQuery version 3:

https://github.com/jquery/jquery/pull/2721

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

Comments

0

With hints from the comment provided, I'm seeing that the hash is never passed to the server:

Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)?

My thought was to decode the hash, hit it via AJAX, and decode it on the server.

Another solution I'm thinking of is to create an endpoint on the server that I can call and pass parameters that correspond to the appropriate dashboard/widget ids. Haven't implemented yet; just a thought.

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.