C
C
crayes232015-10-25 02:20:55
JavaScript
crayes23, 2015-10-25 02:20:55

How does cross domain ajax work?

The task is to take the content of a tag with a certain class on someone else's page and copy its html content into your container (on your page) using ajax.
There is an article on this topic james.padolsey.com/javascript/cross-domain-request...

Please help me understand with an example - create a simple script in the sandbox that copies the contents of the wp_syntax class from the same page james.padolsey.com/javascript/cross -domain-request... and output it to some div block.
Thanks a lot.

--If not ajax, then how to solve this problem using other methods?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mark Doe, 2015-10-25
@crayes23

output.jsbin.com/fifabovafe
Like this - everything works

C
coderisimo, 2015-10-25
@coderisimo

What if you use file_get_contents or curl on your server? That is, you send an ajax request to your server, your server requests another server and returns the results to you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question