Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is a problem with the way jQuery is being used. All jQuery references should be made in functions that are only called after the page is ready, or in a wrapper that makes sure the page is ready.</p> <p>For example, this code needs to be wrapped:</p> <pre><code>jQuery('#start_chat').click(function(){ $(this).data('clicked', true); var b1 = '&lt;?php echo $start; ?&gt;'; var b2 = '&lt;?php echo $end; ?&gt;'; }); </code></pre> <p>Like this:</p> <pre><code>jQuery(function(){ jQuery('#start_chat').click(function(){ $(this).data('clicked', true); var b1 = '&lt;?php echo $start; ?&gt;' var b2 = '&lt;?php echo $end; ?&gt;'; }); }); </code></pre> <p>Setting the <code>.data()</code> isn't going to do you any good here. You're setting some info to the actual var instead of the element because of the way that method works.</p> <p>But there's another problem with the way you're deciding to make AJAX requests, simply putting an if statement there won't make it happen. You would need a listener to make an action actually happen. But rather than get into that why don't you just simplify and do it like this?</p> <pre><code>&lt;script type="text/javascript"&gt; var b1 = '&lt;?= $start ?&gt;', b2 = '&lt;?= $end ?&gt;'; $(function(){ $('#start_chat').click(function(){ $.post('/web/htdocs/www.fattorefamiglia.com/home/wp-content/themes/child_care_creative/chat.php', { b1: '1:00', b2: '23:00' }, function(data) { b1 = data.b1; b2 = data.b2; }, 'json'); }); }); &lt;/script&gt; </code></pre>
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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