Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php to call javascript function

echo '<script type="text/javascript">',
     'jsfunction();',
     '</script>'
;
Comment

call php function in js

<script>
  var phpadd= <?php echo add(1,2);?> //call the php add function
  var phpmult= <?php echo mult(1,2);?> //call the php mult function
  var phpdivide= <?php echo divide(1,2);?> //call the php divide function
</script>
Comment

how to call js function from php

<?php
 if(your condition){
     echo "<script> window.onload = function() {
     yourJavascriptFunction(param1, param2);
 }; </script>";
?>
Comment

PREVIOUS NEXT
Code Example
Php :: sustituir caracteres especiales php 
Php :: make a object php 
Php :: laravel query builder sum 
Php :: laravel old request 
Php :: sort multidimensional array php by key 
Php :: how to set a validation on a value if its not null in laravel php 
Php :: php 2d empty array remove 
Php :: page expire in laravel 
Php :: request get query string laravel 
Php :: laravel date between 
Php :: set default value for column in laravel model 
Php :: laravel check if request wantsjson 
Php :: woocommerce order get_data() 
Php :: foreach total sum 
Php :: symfony password 
Php :: query builder "not in" laravel 
Php :: format money with commas in php 
Php :: php table 
Php :: validation not exists with this id laravel 
Php :: create laravel 9 auth 
Php :: mysqli loop 
Php :: docker check php version 
Php :: laravel hasmany count 
Php :: how to check mobile or desktop in php 
Php :: laravel old value or default 
Php :: php show active page 
Php :: laravel select default old value 
Php :: foreach loop laravel 
Php :: how to send ajax request in laravel 
Php :: laravel sail publish 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =