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
Is dart better than javascript?
What are the benefits of learning javascript?
How to have the status line update when the mouse goes over a link (the support of the status line is sporadic)?
How much do javascript programmers make?
What does the "Access is Denied" IE error mean?
What is the reason for wrapping the entire content of a javascript source file in a function book?
How do functions work in javascript?
How to write html code dynamically using JavaScript?
What is string in javascript?
How to find the selected radio button immediately using the 'this' variable?
Should you disable javascript?
What is variable typing?
How to handle event handlers?
What is singleton class in javascript? Explain
What is memory leak in javascript?