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 |
How can you declare a class in javascript?
What's the purpose of javascript?
What are escape characters?
Have you used any browser for debugging? If yes, how is it done?
What is the context in javascript?
whether javascript runs on client side or server-side?
How do I get javascript?
What are the different types of errors in javascript?
What are screen objects?
What is event bubbling in the dom?
How to comment javascript code?
How many types of variables are there in javascript?