Is there any way to call a JAVASCRIPT function in PHP in AJAX

Answer Posted / arya

<?php
$str = '<script language="javascript">
function get_pop_up()
{
alert("This is a way to call JAVASCRIPT function in PHP");
}
</script>
<input type="button" name="Click" value="Click"
onclick="get_pop_up();">
';

echo $str;
?>

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we change the value of a constant?

537


What is php session and how it works?

524


What is the differences between $a != $B and $a !== $B?

530


How to check if a string contains a character or word in php?

538


What are the different opening and closing tags available in PHP?

571






How to store the uploaded file to the final location?

514


What are the different components used in php for formatting?

533


Does php need html?

529


What is php mean?

558


How to redirect a page in php?

574


What is the purpose of the '.myd' file extension? What do thes file contain?

535


What is the function file_get_contents() useful for?

484


Does php have future?

576


Is it possible multiple inheritance in php?

576


How do you execute a php script from the command line?

523