Variable oproepen voor in de head
Is het mogelijk om via een JAVA functie variable op te roepen en bovenin de pagina te plaatsten.
Voorbeeld
index.php
En include.php
En dan moeten de java-scripts bovenin komen, resultaat:
Heb hier het e.e.a. gevonden, maar lukt niet helemaal.
Groet,
Dennis
Voorbeeld
index.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nieuwe pagina 1</title>
</head>
<body>
<?php
include ('include.php');
?>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nieuwe pagina 1</title>
</head>
<body>
<?php
include ('include.php');
?>
</body>
</html>
En include.php
Code (php)
En dan moeten de java-scripts bovenin komen, resultaat:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nieuwe pagina 1</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
some stuffsome stuff
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nieuwe pagina 1</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
some stuffsome stuff
</body>
</html>
Heb hier het e.e.a. gevonden, maar lukt niet helemaal.
Groet,
Dennis
Gewijzigd op 12/07/2011 23:56:35 door Dennis van Dijk
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?php
$a = 'some stuff';
$b = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>';
$c = '<script type="text/javascript" src="script.js"></script>';
$d = 'some stuff';
?>
$a = 'some stuff';
$b = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>';
$c = '<script type="text/javascript" src="script.js"></script>';
$d = 'some stuff';
?>




