I was trying something similar like this
window.addEvent("domready", function()
{
var content = $("content"), url = "test.php";
//content.load(test.php);
(function(){
noCache = '?a=' + $time() + $random(0, 100);
$('content').load(window.demo_path + 'test.php' + noCache);
});
});
Still no luck.
Can anyone please tell me how can i do that?
On Feb 9, 12:35 pm, Deepali <[email protected]> wrote:
> Ryan,
>
> Its not working.
>
> window.addEvent("domready", function(){
> var content = $("content"), url = "test.php";
> content.load(url);
> (function(){
> content.load(url + "?t=" + $time());
> }).periodical(1000);
>
> });
>
> what we are missing here?
> On Feb 9, 12:21 pm, Ryan Rampersad <[email protected]> wrote:
>
> > Sorry, I read your original question too fast.
>
> > In Request.HTML has an element shortcut that is the same as $(id).load(url).
>
> > You can do something like this
>
> > window.addEvent("domready", function() {
> > var content = $("content"), url = "test.php";
> > content.load(url);
> > (function(){
> > content.load(url + "?t=" + $time());
> > }).periodical(8000);
>
> > });
> > On Tue, Feb 9, 2010 at 1:15 AM, Deepali <[email protected]> wrote:
> > > Thanks for your reply Ryan.
>
> > > Actually i dont wanted to use mata tag. I have page where i am using
> > > two different plugin which works with mootools. i have got the script
> > > where page refreshes automatically but it works with jquery.
> > > here is that code.
>
> > > <script>
> > > $(document).ready(function() {
> > > $("#responsecontainer").load("test.php");
>
> > > var refreshId = setInterval(function() {
> > > $("#responsecontainer").load('test.php?randval='+
> > > Math.random());
> > > }, 8000);
> > > });
> > > </script>
> > > </head>
> > > <body>
>
> > > <div id="responsecontainer">
> > > </div>
>
> > > But i can not use this code. its creating conflict with the mootool
> > > file. so can you please tell me how can i make the page refresh with
> > > mootools?
>
> > > I tried your code but its not working and i am not getting any error
> > > also.
>
> > > p
>
> > > On Feb 9, 12:06 pm, Ryan Rampersad <[email protected]> wrote:
> > > > You probably don't want to use periodical since you'll be reloading the
> > > page
> > > > anyway.
>
> > > > Perhaps you want to use delay instead.
>
> > > > window.addEvent("domready", function() {
> > > > (function(){
> > > > window.location.href = window.location.href;
> > > > }).delay(5000);
>
> > > > });
>
> > > > But if you're just refreshing the page, you may want to use a meta tag
> > > > or
> > > a
> > > > header anyway.
>
> > > > On Tue, Feb 9, 2010 at 12:23 AM, Deepali <[email protected]> wrote:
> > > > > Hello,
> > > > > I want to refresh my test.php page after each and every 5 seconds. I
> > > > > was playing around with periodical function but it seems i am not
> > > > > writing it properly.
>
> > > > > here is my code-
>
> > > > > <script type="text/javascript">
> > > > > window.addEvent('domready', function(){
> > > > > $('content').load('test.php').
> > > > > periodical(5000);
>
> > > > > });
> > > > > </script>
> > > > > </head>
> > > > > <body>
> > > > > <div id="content">
> > > > > Loading content...</div>
>
> > > > > Can anyone please tell me how can i refresh(auto) my page with
> > > > > mootools?
>
> > > > > Thanks in advance.
>
> > > > --
> > > > Ryan Rampersadwww.ifupdown.com
>
> > --
> > Ryan Rampersadwww.ifupdown.com