using a php variable in javascript
| From: | Rich Fox | Date: | Mon, 22 Sep 2003 16:35:43 +0000 |
| Subject: | using a php variable in javascript | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-163495@lists.php.net to get a copy of this message | ||
I have a page with the following code:
<?
$callerWin = $_POST['CallerWin'];
?>
<html>
<body>
<script type="text/javascript">
<!--
so = window.open('','CompanyEdit');
so.location.reload();
window.close();
// -->
</script>
</body>
</html>
I have 'CompanyEdit' hardcoded, but what I want instead is something like:
so = window.open('','$callerWin');
This does not work, of course, but you get the idea: I want to use the value
of the $callerWin php variable in my javascript. Can someone tell me the
syntax for this? My reading of the documentation and trial-and-error have
not met with success.
thanks,
Rich