Prototype equivalent to jQuery loading

I built something using the jQuerys load function to grab a specific element from another page.

Sort of:

$j('#result').load('http://thesite.com .desiredClass') 

What would be the equivalent type of function with a prototype?

+4
source share
1 answer

Take a look at Ajax.Request

 new Ajax.Request('/your/url', { onSuccess: function(response) { var html = response.responseText; var div = new Element("div"); div.innerHTML = html; var content = Element.select(div, ".desiredClass"); $("content").appendChild(content); } }); 

I'm afraid this is the "lower level"

+3
source

Source: https://habr.com/ru/post/1337415/


All Articles