Load Help
muhaza opened this issue · 3 comments
muhaza commented
can displayJS do
$( "#b" ).load( "article.html #target" );
load target on id/class?
arguiot commented
Yes, but not in the way you wrote the code. You can write:
$.load("#b", "article.html", () => {
const page = $. single("#b")
const target = page.querySelector("#target").cloneNode(true) // Getting the #target
$. single("#b").innerHTML = target.innerHTML
})
and it should do the job
arguiot commented
Please tell me if it worked the way you expected so I can close this issue 😄
muhaza commented
Success! Thanks arguiot.