Is it possible to assign a php variable to javascript ? And
also is it possible to fetch the page contents if the url
is not under our control ?
Answer / gagan rana
Yes ,it is possible by doing like the following:
<?php
$x = 'hai!';
echo "<script>var x = '" . $x . "';</script>";
?>
| Is This Answer Correct ? | 3 Yes | 0 No |
What is decodeuri() in javascript?
Will javascript be replaced?
Do I need var in javascript?
Between JavaScript and an ASP script, which is faster?
What are the javascript objects?
Where should I put script tags?
Should you disable javascript?
Write sample code for pagination using java script.
Can array in javascript be extended?
What is javascript bom?
What is stack queue?
What is bom?