We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
EXAMPLE 7
1 parentb89b18b commite20eb63Copy full SHA for e20eb63
index.html
@@ -680,10 +680,10 @@ <h3>
680
<preclass="example">
681
<!-- controller.html -->
682
<script>
683
- connection.send("{string: '你好,世界!',lang: 'zh-CN'}");
684
- connection.send("{string: 'こんにちは、世界!',lang: 'ja'}");
685
- connection.send("{string: '안녕하세요, 세계!',lang: 'ko'}");
686
- connection.send("{string: 'Hello, world!',lang: 'en-US'}");
+ connection.send('{"string": "你好,世界!", "lang": "zh-CN"}');
+ connection.send('{"string": "こんにちは、世界!", "lang": "ja"}');
+ connection.send('{"string": "안녕하세요, 세계!", "lang": "ko"}');
+ connection.send('{"string": "Hello, world!", "lang": "en-US"}');
687
</script>
688
689
<!-- presentation.html -->
@@ -693,7 +693,7 @@ <h3>
693
var spanElt = document.createElement("SPAN");
694
spanElt.lang = messageObj.lang;
695
spanElt.textContent = messageObj.string;
696
- document.appendChild(spanElt);
+ document.body.appendChild(spanElt);
697
};
698
699
</pre>