javascript - Auto Refresh No Scroll Best way to do this -


so i'm asking question again because no 1 has been able figure out. need refresh part of page every few seconds i've tried ajax, because requires .load , script file doesn't work, because refresh not changing time till test due on sections need refreshed. data coming access database , being displayed in browser. database made , changed piece of software records chemical concentrations of plating baths mathematical equations yuou program software, can setup schedules need followed fpr these tests. web browsers displays info. far can whole page refresh no scroll top code. auto refresh no scroll below

<script type="text/javascript">     function refreshpage () {         var page_y = document.getelementsbytagname("body")[0].scrolltop;      window.location.href = window.location.href.split('?')[0] + '?page_y=' + page_y;}      window.onload = function () {         settimeout(refreshpage, 1500);         if (window.location.href.indexof('page_y') != -1 ) {             var match = window.location.href.split('?')[1].split("&")[0].split("=");             document.getelementsbytagname("body")[0].scrolltop = match[1];          }     } </script> 

i've tried ajax fade in , fade out see if working time not update code anove this. ajax code refresh div id below

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>   <script> var auto_refresh = setinterval( function () {          $('#drawrow').fadeout('slow').load('objectshellhtml.htm').fadein("slow");  }, 9000);  </script> 

the info comes out of database script focus on brackets. [itemshtml] seems grab data while draw row draws columns above data. need info in brackets refreshed only. refreshes ie refresh button or auto refresh no scroll script top

<div id="drawrow"><script type="text/javascript">             drawrow ("",dummy1","dummy2","dummy3","dummy4","dummy5",1,-1,"dummy6",1,0,0,"dummy7");             [itemshtml]</script></div> 

i have div tags section need refreshed said there no source file load data .load. there other way refresh data pushing refresh button on e or using first script posted, focusing refresh on drawrow part of page? main reason there lot of images , refresh no scroll seems flash if page not scrolled top big problem refreshing every 1.2 seconds i'm trying accomplish. i've tried using source file im writing in load .load doesn't work either. appreciated!!!

turns out can use ajax cannot select div page want load. can insert whole html page div select. there memory leak can't figure out???

    loc = window.location.pathname; //grabs page url pagediv1 = "#pagebody"; pathname = loc.substring(48, loc.lastindexof('.') + 4); //parses out url except htm file name settimeout (function() {        $(pagediv1).load(pathname, null, function() {                   });      },3000); 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -