I developed a chat, to implement it, I need to add a .js page (so the client does not have the job of creating the markup on your site, just import js and ready as a jquery plugin) it works basically so there is an html page where it looks for the tag (html) and plays inside the body of the client page, I did the following:
This is an example (The original code is larger, but this snippet summarizes the problem)
var ffchat = ffchat || (function () {
return {
addChat: function (Args) {
$(function () {
$.get('http://meuhost.com/chat/partial_chat.html', function (data) {
var html = $(data);
$("body").append(html);
});
});
}
};
}());
It worked perfectly in my local tests (same host), the problem is that the browser blocks this request when it is to another host, it prevents me from getting the html on my server.
How can I search an html file from my server and embed it in a client page?
Remembering that this file has css, js and html to customize the chat on the client page, the chat is in an iframe within this file.