Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Replacing a part of my webpage with another html file Reply To: Replacing a part of my webpage with another html file

#236063
Shikkediel
Participant

Sounds like one for jQuery (Ajax) :

$(function() {

    $('#readmore').one('click', function() {

    $('#parentdiv').load('newcontent.html');
    });
});

http://api.jquery.com/load/

You could also use a text file for it.

Another approach – add all content and hide the second one, then flip visibility once the button is clicked.