I'm trying to develop something that would allow a site owner to include a script I provide to send back data to my server and return some HTML that gets appended into a div
on the requesting site.
For example: Bob's Tires embeds my script in the header (or wherever)...something like this:
<script src="https://example.com/special.js"></script>
I would need data sent back to this script so I can return some HTML. In this case, find the div with a specific class and send me the class name.
<div class="special 123456></div> <!--this would be on Bob's site-->
What I would want back is the "123456". I know how to do this when writing the code to live all on the same page/domain, but how do I say
$(".special").prop("classList")
for Bob's Site and send this back to my server so I can send something back based on this data (i.e., something specific for "123456")?