Newbie jquery question [SOLVED]
Posted: Mon Jul 26, 2010 3:39 pm
I hope I'm posting in the right place. I have problems getting a div id updated by jquery. In a simple html page I get the div updated but when I insert it to my CMSMS template there is nothing. I'm sure that there is a simple solution for this but I tried to google for a couple of days and I havn't figured out what I'm doing wrong. My template is a custom 960.gs based and works perfectly otherwise. My code looks like this (only part of it, and this is between tags)
and lower on the page I have this
The test text blinks for a ms but then its gone. I can see in the apache log that calls are made to the php script (that just has a echo date.....) and it works if I calls it from a basic html page. The div is inside of lots of other divs if that could be the problem...
Any ideas?
Thanks in advance!
Code: Select all
{literal}
<__script__ src="http://code.jquery.com/jquery-latest.js"></__script>
<__script__>
$(document).ready(function() {
$("#dbdata").load("http://server/script.php");
var refreshId = setInterval(function() {
$("#dbdata").load('http://server/script.php?randval='+ Math.random()); }, 10000);
});
</__script>
{/literal}
Code: Select all
<div id="dbdata">test</div>
Any ideas?
Thanks in advance!