How can you insert javascript in php code?

Answer Posted / vivek srivastava

You can write Java Script in PHP in a very simple way so as
I did:

<?php
some php code...
?>

<script type="text/javascript">
function someFun()
{
function code....
}
</script>

<?php
some php code...
?>

Is This Answer Correct ?    72 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me what kind of things have you done on the social side?

502


Are php sessions secure?

529


Tell me what are sql injections, how do you prevent them and what are the best practices?

507


Tell me what's the difference between include and require?

547


Tell me will a comparison of an integer 12 and a string "13" work in php?

652






can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.

3067


What is the difference between explode() and split() functions?

496


Explain Type juggling?

563


What is whitespace in html?

524


Distinguish between urlencode and urldecode?

551


what is PDO?

799


What is the use of mysql_fetch_assoc in php?

510


Tell me how can we define a variable accessible in functions of a php script?

522


Tell me how to find the position of the first occurrence of a substring in a string?

489


What is an array in php?

615