Skip to content

Commit 86c1866

Browse files
Add: CodeSandboxes 105. & missing scripts/styles in Markdown
1 parent 33c0600 commit 86c1866

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,6 +2613,14 @@ For larger projects or better code organization, it's common practice to separat
26132613
</html>
26142614
```
26152615

2616+
In `script.js`, write a simple script:
2617+
2618+
```javascript
2619+
function greet() {
2620+
alert("Hello, world!");
2621+
}
2622+
```
2623+
26162624
[![Edit 066-External JavaScript Example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/066-external-javascript-example-sttc6x)
26172625

26182626
- [^66]CodeSandbox: External JavaScript Example.
@@ -3827,11 +3835,32 @@ Performance optimization is crucial for delivering fast and responsive web exper
38273835
</html>
38283836
```
38293837

3838+
In `script.js`, write a simple script:
3839+
3840+
```javascript
3841+
document.addEventListener("DOMContentLoaded", function () {
3842+
alert("Welcome to My First Website!");
3843+
});
3844+
```
3845+
3846+
In `styles.css`, add simple styling:
3847+
3848+
```css
3849+
body {
3850+
font-family: Arial, sans-serif;
3851+
}
3852+
3853+
h1 {
3854+
color: navy;
3855+
}
3856+
```
3857+
38303858
[![Edit 104-HTML Performance Optimization Techniques](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/104-html-performance-optimization-techniques-qm3w7j)
38313859

38323860
- [^104]CodeSandbox: HTML Performance Optimization Techniques.
38333861

38343862
[^104]:[CodeSandbox: HTML Performance Optimization Techniques.](https://qm3w7j.csb.app/), last access: September 10, 2024.
3863+
38353864
- In this example, the `<link rel="preload">` tag is used to prioritize the loading of critical resources (CSS and JavaScript files) by indicating their importance and specifying the `as` attribute to define the resource type.
38363865

38373866
##### Code Example: HTML Minification and Compression
@@ -3840,6 +3869,12 @@ Performance optimization is crucial for delivering fast and responsive web exper
38403869
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Optimized Website</title></head><body><h1>Hello, World!</h1><p>Welcome to our optimized website.</p></body></html>
38413870
```
38423871

3872+
[![Edit 105-HTML Minification and Compression](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/105-html-minification-and-compression-vdpynt)
3873+
3874+
- [^105]CodeSandbox: HTML Minification and Compression.
3875+
3876+
[^105]:[CodeSandbox: HTML Minification and Compression.](https://qm3w7j.csb.app/), last access: September 11, 2024.
3877+
38433878
- This example demonstrates a minified HTML document where unnecessary whitespace, comments, and redundant attributes have been removed to reduce file size and improve load times.
38443879

38453880
##### Code Example: Lazy Loading of Images

0 commit comments

Comments
 (0)