Created
April 26, 2020 12:27
-
-
Save parzibyte/8d4cdfd899af30fcc153dfb4dd214dd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<?php | |
// Esta variable puede venir de cualquier lugar | |
$miVariable = "Parzibyte"; | |
// Aquí más código... | |
?> | |
<head> | |
<title>PHP Test</title> | |
<script type="text/javascript"> | |
window.miVariableEnJavaScript = "<?php echo $miVariable ?>"; | |
// Justo aquí estamos pasando la variable ----^ | |
</script> | |
<!--Y ya podemos incluir otros scripts ;)--> | |
<script type="text/javascript" src="script.js"></script> | |
</head> | |
<body> | |
<p>Parzibyte.me</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment