jQuery load access denied

0

I am facing a problem already known by many, in IE it is possible to use Activex to get the user logged on the network.
In Chrome this is not possible and after many searches I got the same answer.
I know there is a library in Java that can get this information independent of the browser, however the project is too small and I do not have all the understanding to use all Java framework, so it should be developed in PHP even using a simple server with Tomcat .
As an attempt to solve a URL was developed using Java that returns the user and only the user even more.
But I can not manipulate this information I tried via load, ajax, json, jsonp, but I always get an impossible access.
Via $("p").html('<object data="url/login" />') I can print the information on the page but I can not convert it to string so I can use it. Home If anyone could give me a light as a solution for this I would be very grateful. Thank you.

    
asked by anonymous 08.09.2016 / 17:50

1 answer

1

$().load is not used to insert DOM into the page, it is used for HTML content requests generated by the backend to populate elements on the front end, if you want to load an element object do so:

$("p").html('<object data="url/login" />');

Now if you just want to get information from the back end of a request, I think what you're looking for is something like:

$.ajax("url/login", {
    "cache": false
}).done(function(resposta) {
    alert(resposta);
}).fail(function(erro) {
    alert(erro);
});

If the backend data is json, then do so:

$.ajax("url/login", {
    "dataType": "json",
    "cache": false
}).done(function(resposta) {
    console.log(resposta);//Imprime no console
}).fail(function(erro) {
    alert(erro);
});
    
08.09.2016 / 18:03