You can't just retrieve a particular section within the remote page and display it using this script, no. However, what you can do is wrap that section you want shown in a DIV tag with a unique ID attribute, then, once the entire remote page has been fetched, modify the script to show just that section.
Assuming your external page's content looks like this:
Code:
<h2 id="mysection">Intended portion to display.</h2>
Welcome to Dynamic Drive, the #1 place on the net to obtain free, original DHTML & Javascripts to enhance your web site! Last updated Oct 29th, 08': Revised Script(s)
And you only want to show "mysection" on the main page when retrieved, you'd simply modify the following function within the script from:
Code:
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}
to instead:
Code:
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).style.display="none"
document.getElementById(containerid).innerHTML=page_request.responseText
document.getElementById(containerid).innerHTML=document.getElementById("mysection").innerHTML
document.getElementById(containerid).style.display="block"
}
}
where "mysection' should correspond to the ID of the DIV within your external page that's to be shown.
Bookmarks