Code:
expandcontent(this, \'sc1\')
Looks bad to me. The this keyword is normally meant to refer to the element being clicked. Here it refers to the body. It should be replaced by a reference to the element that normally would be clicked to display sc1.
From the demo, addition red:
Code:
<div class="headers"><img id="ac1" src="minus.gif" class="showstate" onClick="expandcontent(this, 'sc1')" />What is JavaScript?</div>
<div id="sc1" class="switchcontent">
JavaScript is a scripting language ori . . .
and then (without escaping for PHP):
Code:
<body onload="expandcontent(document.getElementById('ac1'), 'sc1');window.scrollTo(0,600);">
Bookmarks