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.

Fillip Peyton
  • 3,637
  • 2
  • 32
  • 60

2 Answers2

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

wawka
  • 4,828
  • 3
  • 28
  • 22
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.

Community
  • 1
  • 1
Fillip Peyton
  • 3,637
  • 2
  • 32
  • 60