my php code will check after a condition. if the condition is true i want it to trigger a jquery code that displays a box.
i wonder how i can trigger a jquery code with php?
my php code will check after a condition. if the condition is true i want it to trigger a jquery code that displays a box.
i wonder how i can trigger a jquery code with php?
Output the jQuery code into the page using PHP. PHP runs server-side, jQuery runs client-side, after all of the PHP code has already executed and the page has been sent to the browser. They don't directly talk; one writes the other.
Well, you could only trigger it on page load. The way you would do that is by using PHP to write some javascript:
<?php
if($some_condition) {
echo '<script>var executeCode = true;</script>';
}
?>