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 are javascript objects?
What are the advantages of javascript?
How javascript sort function works?
What is the use of blur function in JavaScript?
What are the data types in js?
What is "strict mode" and how is it used in JavaScript?
What are all the types of Pop up boxes available in JavaScript?
Explain the difference between javascript and an asp script.
Is array an object javascript?
How to determine the state of a checkbox using javascript?
Name some of the built-in methods and the values returned by them.
What's the Difference Between Class and Prototypal Inheritance?