E
E
exitialis2015-09-23 21:57:18
JavaScript
exitialis, 2015-09-23 21:57:18

How to get a specific page block using ajax?

Hello! I am developing one application, and the following question appeared: how can I get a specific block from the page using an ajax request? For example, there is a page at example.ru . This page has <div class = "profile">...</div>. Only this div needs to be loaded, not the entire page.
The project does not use JQuery, so you don't need to say you don't know how to use Google. I saw solutions for JQuery, but I don’t know how to implement the same thing in pure JavaScript. Thank you in advance!

For the lazy: the solution is to create a document from the page received by ajax , and then search for the necessary element using dom functions and display it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
littleguga, 2015-09-23
@exitialis

What does it mean to receive? How can the script know which part of the page to load?
You can ajax load the entire page, and then display only the block you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question