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 |
Explain mul function in javascript?
What is encodeuri() function?
Is it possible to use javascript to change the meta-tags of the page?
Explain the different types of pop-up boxes you can create in JavaScript.
What is lazy loading java?
What is npm repository?
What is the prototype object in javascript and how it is used?
How do you round a value in javascript?
What is a closure javascript? Explain
Which built-in method returns the length of the string?
What is a way to append a value to an array?
Where do I write javascript code?