You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,35 +3,37 @@
3
3
4
4
A trick I learned from working with CHATGPT, to solve an interesting problem I had.
5
5
6
-
How do we create modules of javascript, thats embeddable across the web, in one copy paste code, like you can do with google sites?
6
+
***How do we create modules of javascript, thats embeddable across the web, in one copy paste code, like you can do with google sites***?
7
7
8
8
9
-
Many programmers use import and export, and multiple files, but I wanted to have it all one copy and paste, and have it leggible.
9
+
Many programmers use _import_ and _export_, and multiple files, but I wanted to have it all one copy and paste, and have it leggible.
10
10
11
11
12
12
How this trick works is, you create your modules with the script tag, then you give them Id's to be called as objects.
13
13
14
14
15
-
Modules are just individual <scripts> in seperate files. The difference between this and regualar module programming of javascript is:
15
+
# Modules are just individual ***<scripts>*** in seperate files.
16
+
17
+
The difference between this and regualar module programming of javascript is:
16
18
17
19
18
20
19
21
It has to be layered in a specific order, like you do within an algorithm.
20
22
21
-
This is due to how the DOM loads things in HTML.
23
+
_This is due to how the DOM loads things in HTML_.
22
24
23
-
Its an HTML file, not a javascript one.
25
+
***Its an HTML file, not a javascript one***.
24
26
25
27
26
28
27
29
With this trick, you can create individual callable scripts as objects, that can be further troubleshot and debugged,
28
30
29
-
all embeddable.
31
+
_all embeddable_.
30
32
31
33
32
34
33
35
34
-
To check if it works, run the file, which is a blank white screen, and hit inspect to read the console.log to see the sum equal
36
+
***To check if it works, run the file, which is a blank white screen, and hit inspect to read the console.log to see the sum equal***
35
37
36
38
4
37
39
@@ -40,6 +42,8 @@ To check if it works, run the file, which is a blank white screen, and hit inspe
40
42
Two scripts interacting and calling each other, from two seperate tags in the same html file.
41
43
42
44
45
+
This is Unlicensed, as a thank you to <sup>god</sup> for giving me the privilege, Codecademy for the free knowledge, and chatGPT for the free helper to solve this complex problem that school couldnt.
0 commit comments