File tree 7 files changed +31
-55
lines changed
7 files changed +31
-55
lines changed Original file line number Diff line number Diff line change 13
13
14
14
<!-- Link to Font or Icon libraries (optional) -->
15
15
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css ">
16
-
16
+ < link rel =" icon " type =" image/png " sizes =" 32x32 " href =" favicon.png " >
17
17
<!-- Include any external JavaScript or CSS libraries (optional) -->
18
18
</ head >
19
19
< body >
20
20
21
21
<!-- Header Section -->
22
- < header >
23
- < h1 > Quantum4HEP</ h1 >
24
- < nav >
25
- < ul >
26
- < li > < a href ="index.html "> Home</ a > </ li >
27
- < li > < a href ="projects.html "> Projects</ a > </ li >
28
- < li > < a href ="peoples.html "> Peoples</ a > </ li >
29
- < li > < a href ="future.html "> Future Ideas</ a > </ li >
30
- < li > < a href ="https://github.com/Quantum4HEP "> Github Repository</ a > </ li >
31
- </ ul >
32
- </ nav >
33
- </ header >
22
+ < div id ="header "> </ div >
34
23
35
24
<!-- Main Content Section
36
25
<main>
@@ -61,6 +50,6 @@ <h2>Our Services</h2>
61
50
</ footer >
62
51
63
52
<!-- Link to JavaScript file (optional) -->
64
- <!--< script src="script.js"></script> -- >
53
+ < script src ="script.js "> </ script >
65
54
</ body >
66
55
</ html >
Original file line number Diff line number Diff line change 1
- <!-- header.html -->
1
+ <!-- -->
2
2
< header >
3
3
< h1 > < img src ="Quantum4hep_logo.png " alt ="Quantum4HEP Logo " width ="200 " height ="200 "> Quantum4HEP</ h1 >
4
4
Original file line number Diff line number Diff line change 13
13
14
14
<!-- Link to Font or Icon libraries (optional) -->
15
15
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css ">
16
-
16
+ < link rel =" icon " type =" image/png " sizes =" 32x32 " href =" favicon.png " >
17
17
<!-- Include any external JavaScript or CSS libraries (optional) -->
18
18
</ head >
19
19
< body >
@@ -50,15 +50,7 @@ <h2>Our Services</h2>
50
50
</ footer >
51
51
52
52
<!-- Link to JavaScript file (optional) -->
53
- <!--<script src="script.js"></script> -->
54
- < script >
55
- // Load the header.html content into the #header div
56
- fetch ( "header.html" )
57
- . then ( response => response . text ( ) )
58
- . then ( data => {
59
- document . getElementById ( "header" ) . innerHTML = data ;
60
- } )
61
- . catch ( error => console . error ( 'Error loading header:' , error ) ) ;
62
- </ script >
53
+ < script src ="script.js "> </ script >
54
+
63
55
</ body >
64
56
</ html >
Original file line number Diff line number Diff line change 13
13
14
14
<!-- Link to Font or Icon libraries (optional) -->
15
15
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css ">
16
-
16
+ < link rel =" icon " type =" image/png " sizes =" 32x32 " href =" favicon.png " >
17
17
<!-- Include any external JavaScript or CSS libraries (optional) -->
18
18
</ head >
19
19
< body >
20
20
21
21
<!-- Header Section -->
22
- < header >
23
- < h1 > Quantum4HEP</ h1 >
24
- < nav >
25
- < ul >
26
- < li > < a href ="index.html "> Home</ a > </ li >
27
- < li > < a href ="projects.html "> Projects</ a > </ li >
28
- < li > < a href ="peoples.html "> Peoples</ a > </ li >
29
- < li > < a href ="future.html "> Future Ideas</ a > </ li >
30
- < li > < a href ="https://github.com/Quantum4HEP "> Github Repository</ a > </ li >
31
- </ ul >
32
- </ nav >
33
- </ header >
22
+ < div id ="header "> </ div >
34
23
35
24
<!-- Main Content Section
36
25
<main>
@@ -61,6 +50,6 @@ <h2>Our Services</h2>
61
50
</ footer >
62
51
63
52
<!-- Link to JavaScript file (optional) -->
64
- <!--< script src="script.js"></script> -- >
53
+ < script src ="script.js "> </ script >
65
54
</ body >
66
55
</ html >
Original file line number Diff line number Diff line change 13
13
14
14
<!-- Link to Font or Icon libraries (optional) -->
15
15
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css ">
16
-
16
+ < link rel =" icon " type =" image/png " sizes =" 32x32 " href =" favicon.png " >
17
17
<!-- Include any external JavaScript or CSS libraries (optional) -->
18
18
</ head >
19
19
< body >
20
20
21
21
<!-- Header Section -->
22
- < header >
23
- < h1 > Quantum4HEP</ h1 >
24
- < img src ="Quantum4hep_logo.png " alt ="Quantum4HEP Logo " width ="200 " height ="100 ">
25
- < nav >
26
- < ul >
27
- < li > < a href ="index.html "> Home</ a > </ li >
28
- < li > < a href ="projects.html "> Projects</ a > </ li >
29
- < li > < a href ="peoples.html "> Peoples</ a > </ li >
30
- < li > < a href ="future.html "> Future Ideas</ a > </ li >
31
- < li > < a href ="https://github.com/Quantum4HEP "> Github Repository</ a > </ li >
32
- </ ul >
33
- </ nav >
34
- </ header >
22
+ < div id ="header "> </ div >
35
23
36
24
<!-- Main Content Section
37
25
<main>
@@ -62,6 +50,6 @@ <h2>Our Services</h2>
62
50
</ footer >
63
51
64
52
<!-- Link to JavaScript file (optional) -->
65
- <!--< script src="script.js"></script> -- >
53
+ < script src ="script.js "> </ script >
66
54
</ body >
67
55
</ html >
Original file line number Diff line number Diff line change
1
+ async function loadHeader ( ) {
2
+ try {
3
+ const response = await fetch ( "header.html" ) ;
4
+
5
+ // Check if the file was found
6
+ if ( ! response . ok ) {
7
+ throw new Error ( `HTTP error! status: ${ response . status } ` ) ;
8
+ }
9
+
10
+ const data = await response . text ( ) ;
11
+ document . getElementById ( "header" ) . innerHTML = data ;
12
+ } catch ( error ) {
13
+ console . error ( "Error loading header:" , error ) ;
14
+ }
15
+ }
16
+
17
+ // Call the function to load the header
18
+ loadHeader ( ) ;
You can’t perform that action at this time.
0 commit comments