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 null javascript?
How to find the selected radio button immediately using the 'this' variable?
How to make a array as a stack using javascript?
What is dom in javascript?
Which javascript is best?
What is the use of a boolean object in javascript?
name any two javascript functions which are used to convert nonnumeric values into numbers?
How many types of functions are there in javascript?
Explain prototypal/differential inheritance?
If an array with name as "names" contain three elements, then how will you print the third element of this array?
What is the statement to enable strict mode in javascript quiz?
Does javascript have the concept level scope?
TypeError: document.getelementbyid(...) is null?
Should I disable javascript?
What is viewstate in javascript?