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

What is php and why we use it?

1025


What's the difference between accessing a class method via -> and via ::?

1129


How does php strcmp work?

1073


How do you find the length of a string in php?

996


How to access a global variable inside a function?

1015


What is the goto statement useful for?

1008


What is a query in php?

916


Which function is used in php to count the total number of rows returned by any query?

1038


Is PHP runs on different platforms (Windows, Linux, Unix, etc.)?

1059


what are the differences between php and perl

2052


How to include a file code in different files in php?

1113


Do I need to install php after xampp?

1007


How to count a number of words in a string in php?

971


How to stop the execution of php script?

985


What is multidimensional array in php?

1019