I was viewing a Appcelerator Titanium Video Tutorial and I saw they used syntax like
<script type="text/php">
...
global $window, $document;
mysql_connect(...) or die $window->alert('...');
$document.getElementById('xxx');
...
</script>
so I have a few questions. Is it any difference if I use <?php ?>
without setting $window
and $document
- won't they be "unset" variables?
I guess I can use (basic, not jQuery for example) Javascript functions like alert
and getElementById()
in PHP too?