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
Name the types of functions.
What are the data types in js?
What percentage of websites use javascript?
Where can I learn javascript?
What is stack queue?
Difference between window.onload and onDocumentReady?
Can you assign a anonymous function to a variable?
How compare function works javascript?
What is use of settimeout function in javascript?
What is a name function in javascript & how to define it?
List out the different ways an HTML element can be accessed in a Javascript code?
Auto insurance project..How to explain project in interviews.Using Automation tool (selenium).
How do I view javascript in chrome?
Is client side front end?
Can we learn javascript without knowing java?