Commit f9d9859 1 parent b82b357 commit f9d9859 Copy full SHA for f9d9859
File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,29 @@ change.
133
133
134
134
<CodePen id = " xbKqpZG" title = " Terminal Figlet" />
135
135
136
+ ## DOM Nodes and jQuery Objects
137
+
138
+ jQuery Terminal don't allow to echo HTML directly, to prevent any misbehavior of your users, but you can
139
+ echo DOM nodes (elements that represent HTML tags inside the browser):
140
+
141
+ ``` javascript
142
+ const para = document .createElement (' p' );
143
+ para .innerText = ' hello, world!' ;
144
+ term .echo (para);
145
+ ```
146
+
147
+ and jQuery object:
148
+
149
+ ``` javascript
150
+ const $iframe = $ (' <iframe src="https://example.com"></iframe>' );
151
+ term .echo ($iframe);
152
+ ```
153
+
154
+ Dolar function from jQuery also accepts HTML code and it create jQuery object from it, that object
155
+ which wraps DOM node, can later be inserted into document.
156
+
157
+ <CodePen id = " VYZpVQY" title = " echo DOM node and jQuery object" height = { 460 } />
158
+
136
159
## renderHandler
137
160
138
161
When you have renderHandler you can print basciall anything, any kind of objects. Even [ React
You can’t perform that action at this time.
0 commit comments