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
How do I enable javascript on google?
How compare function works javascript?
What is the difference between registerclientscriptblock and registerstartupscript?
How would you organize your javascript code?
What is asynchronous javascript?
What are the different functional component in javascript?
What is called variable typing in javascript?
Write the point of difference between web-garden and a web-farm?
What are the Advantages and Disadvantages of JavaScript?
Can you assign an anonymous function to a variable and pass it as an argument to another function?
What is callback in javascript?
What percentage of websites use javascript?
What are the features of javascript?
How to load another html page from javascript?
Explain the typeof operator?