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

write a prog using insert,update,delete in this manner as output? name: phno. add button 1.name phno. edit button delete button 2.

1958


How can cross site request forgery csrf be prevented?

891


How can we create a database using php?

1060


Explain what is the use of "echo" in php?

977


Define urlencode() and urldecode() used in php?

1120


How to write php function in html onclick?

891


What is $row in php?

904


How arrays are used in php?

994


How to run the interactive php shell from the command line interface?

1037


What is php and what does it do?

1002


What is polymorphism with example in php?

903


Which php framework is best for beginners?

1032


Explain me how failures in execution are handled with include() and require() functions?

969


What is the importance of "method" attribute in a html form?

969


Will a comparison of an integer 12 and a string "13" work in php?

894