Welcome Guest, Not a member yet? Register   Sign In
Display message in footer in interval and refresh only this message in view
#1

[eluser]kresimir[/eluser]
I used jquery setinterval (I put 5sec for testing purpose only!) and div to check IP connection and display status in footer table column div (footer.php).
Code:
[removed]
   setInterval("refresh_IP();",5000);
    function refresh_IP(){
    $('#refresh').load(location.href + ' #time');
    }
  [removed]
<div id="refresh">
<div id="time">
  &lt;?php
   $host="213.191.128.8";
   exec("ping -n 1 " . $host, $output, $result);
   if ($result == 0)
    echo "<span  green; font-weight: bold'>Ok!</span>";
   else
    echo "<span  red; font-weight: bold'>NotOk!</span>";
  ?&gt;
</div>
</div>
The status is displayed when I enter into some module, but if I disconnect eth cable this staus is not change ?
This status is changed if i went into some other module ( home or customers..)
I googled and found that isnt possible to do it with php and html.
I found nice tutorial for jquery on:http://blog.codebusters.pl/en/refresh-content-automatically-after-some-period-time-jquery
Is it possible to dinamically change ONLY this status in view with jquery ?
#2

[eluser]InsiteFX[/eluser]
How are you going to change status in a view if you are no longer connected to a server?
#3

[eluser]kresimir[/eluser]
Dear friend,
I understand that controller produce displayed data and finished action on the server.
i expected that jquery will do this action. But you told that it is impossible this way....
Can you point me the way I can solve this problem ?
#4

[eluser]kresimir[/eluser]
I dont understand what is the purpose of this forum ?
I only need a help and got a help :"How are you going to change status in a view if you are no longer connected to a server?"
I kindly asked for a help, but I see that I asked at a wrong place.
Is it so hard to point me that the ajax who will call php program can do it anywhere in the view ?




Theme © iAndrew 2016 - Forum software by © MyBB