Topic
2 replies Latest Post - ‏2014-09-20T11:04:43Z by jitupkp
ianangus
ianangus
1 Post
ACCEPTED ANSWER

Pinned topic different scroll behaviour between form submission text submission

‏2012-03-02T17:59:51Z |
I'm trying to create a text link which will maintain the position on the page when submitted. When a form 'submit' button is used the position is maintained, but when the text link is used the scroll reverts to the top.

Here's my code:

<script type="text/javascript">
function loadXMLDoc(url)
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("ajaxDiv").innerHTML=xmlhttp.responseText;
}
}

xmlhttp.open("GET",url,true);
xmlhttp.send();
}
</script>

Updated on 2012-04-30T10:26:51Z at 2012-04-30T10:26:51Z by storres27