Note that there are some explanatory texts on larger screens.

plurals
  1. POAttempting to load a "div" as dynamic content is returned
    primarykey
    data
    text
    <p>I have a PHP program which performs a series of key driven SSH connections (as Apache user www-data), and executes scripts on the remote server which check the statuses of a couple services/deamons. Based on the reported status, "Running" or "Stopped," a function determines the appropriate image, green check or red 'x', that should be display within a div table cell.</p> <p>It looks like this:</p> <p><img src="https://i.stack.imgur.com/lIO5s.jpg" alt="service status screen capture"></p> <p>The problem is 9 servers are polled and 18 div table cells are dynamically built. I'd like to refresh/display each div as the data is returned from each SSH call. </p> <p>This is the PHP code where each SSH call is made the div containing the result is inserted:</p> <pre><code> $cmd_string=buildServiceCallString($distIP, "VolCreationService","serviceCheck"); echo "&lt;div class=\"statTableRow\"&gt;"; echo "&lt;div class=\"statData statTableCell\"&gt;"; $cmd_output=shell_exec($cmd_string); echo "&lt;span class=\"serviceTitle\"&gt;VolCreationService: &lt;img class=\"runStatImage\" src=\"".displayRunStatusImage($cmd_output)."\"&gt;&lt;/span&gt;"; $cmd_output=""; echo "&lt;/div&gt;"; //end statTableCell echo "&lt;/div&gt;"; //end statTableRow </code></pre> <p>I've made an effort to understand the jQuery .load() method, but it hasn't clicked yet. I imagine this will involve a callback, but I don't understand how the element is accessed and displayed with an asynchronous call.</p> <p>Any advice is greatly appreciated!</p> <p>-TU</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload