arguiot/DisplayJS

Load Help

muhaza opened this issue · 3 comments

can displayJS do

$( "#b" ).load( "article.html #target" );

load target on id/class?

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

Please tell me if it worked the way you expected so I can close this issue 😄

Success! Thanks arguiot.