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 can we submit from without a submit button?

994


What is the difference between for and foreach loop in php?

1078


How to download file in php?

942


Which Scripting Engine PHP uses?

1153


Which php global variable is used for uploading a file?

1002


What is the difference between exception::getmessage and exception::getline?

948


Which function parses an English textual date or time into Unix timestamp in PHP.

981


What is the difference between overloading and overriding in php?

1016


Why php language is used?

966


Why many companies are switching their current business language to php? Where php basically used?

935


Which programming language does php resemble?

935


What is the correct php command to use to catch any error messages within the code?

1060


What is the current stable version of php?

1023


What does csrf token mean?

917


Which of the delimiter is ASP style?

1075