Show data from my site on other sites

2

I have a website where I want to make a widget available (or something). I want to do more or less how some sites do: They give a JS + div link to the user. It simply puts it on the site and the data appears.

My site is PHP, I already managed to get some data with JQuery Load like this:

$("#divTestArea2").load("http://meusite.com/paginadedados #dados");

As you can see, it's a simple load (but take what I want). Now that I can not find anything on the Internet anymore. I would like to manipulate the CSS of the data.

This data page is very simple - it has only Divs tagging without CSS

<div id="dados">

    <div id="iddoprimeirodado">
        Dado1
    </div>
    <div id="iddosegundodado">
        Dado2
    </div>
</div>

When I load the data, the data appears unformatted.

How do I format in the above JS, and already appear correct on my user's website? What do I have to put in my code? I've been looking for a lot, and found nothing that I could understand, since I'm starting with JS and Jquery.

And of course I'd like to build the links by sending them to my site.

Unfortunately the documentation is vague and I did not find anything specific for that. How should I search? Where do I find more specific documentation for this?

Thank you in advance. Hugs

    
asked by anonymous 19.01.2016 / 16:43

1 answer

1

As suggested, I am formalizing the answer:

Test this way:

$("#divTestArea2").load("http://meusite.com/paginadedados #dados", function(){
   $("#divTestArea2").css("atributo_css", "valor");
});
    
22.02.2016 / 21:19