IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this community and its apps will no longer be available. More details available on our FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2014-09-20T11:04:43Z by jitupkp
ianangus
ianangus
1 Post

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
  • storres27
    storres27
    1 Post

    Re: different scroll behaviour between form submission text submission

    ‏2012-04-30T10:26:51Z  
    I'm having the same problem! And since I am a newbie, I need help too. Hopefully people will reply.
  • jitupkp
    jitupkp
    104 Posts

    Re: different scroll behaviour between form submission text submission

    ‏2014-09-20T11:04:43Z  
    • storres27
    • ‏2012-04-30T10:26:51Z
    I'm having the same problem! And since I am a newbie, I need help too. Hopefully people will reply.

    get more help

    http://techgurulab.com/course/ajax-quiz-online/