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 Posted / 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 |
Post New Answer View All Answers
What is enum with example?
Explain how to detect the operating system on the client machine?
What is a module in javascript?
What is the use of blur function?
What is the data type of variables in javascript?
What Does JavaScript Void(0) Mean?
How do you disable javascript?
What is innertext javascript?
What is a framework programming?
What close() does in javascript?
How do you round a value in javascript?
What javascript method would convert the string “20” to an integer (on the fly) so “20” + 20 = 40?
What are self invoking functions?
How to get an element by class in javascript ?
What is a named function in JavaScript? How to define a named function?