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 do I use javascript to password-protect my web site?
How to create objects in JavaScript?
What is the instanceof operator in JavaScript?
Difference between undefined and undeclared variables?
What is event bubbling and capturing in javascript?
What is the statement to enable strict mode in javascript quiz?
Is JavaScript a case-sensitive language?
What is the default scope in javascript?
Is a relation always a function?
Why is javascript not oop?
What is decodeuri(), encodeuri() in javascript?
Where should I put script tags?