Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can you insert javascript in php code?

Answer Posted / webguy

Mukesh(watch out for syntax errors) and atanu are right.
VIvek seemed have misunderstood the question. It's more of
injecting JS code within PHP code segment like this:

<?php
echo "<script type='text/javascript'>";
echo "alert('jams bond');";
echo "</script>";
?>

OR

<?php
echo "<script type='text/javascript'>alert('jams
bond');</script>";
?>

Is This Answer Correct ?    24 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How cookies are trported from browsers to servers?

1022


What is php variable?

1004


How many ways to include variables in double-quoted strings in php?

1060


What is == and === in php?

907


Can you pass an array into a function?

1071


What is the difference between characters 34 and x34?

1024


What is url encoding and decoding in php?

1103


Why use php artisan serve?

963


Tell me how is it possible to know the number of rows returned in result set?

1090


What does $_server mean?

995


What is php's mysqli extension?

1012


Can you define an array argument as a reference type?

922


What should we do to be able to export data into an excel file?

1031


What is php programming used for?

998


Are sessions stateless?

906