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
Basic methods for opening a popup window using javascript?
How to count the number of element in an array using javascript?
how can we retrieve value from one database server and store them another database server using sql server code
What are the three core languages in web pages?
What is "this"?
What's Prototypes for JavaScript
How to make elements invisible?
Where should I put script tags?
Do unused imports affect performance javascript?
What is Number object in JavaScript?
How do you write an if statement in javascript?
What is the method for reading and writing a file in javascript?
What and where are the best javascript resources on the web?
What are the primitive data types in JavaScript?
How do I run javascript in chrome?