You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
Fix examples/browser/browserTest.js
(#2952)
This seems to have been broken for ages
This commit is contained in:
committed by
GitHub
parent
16d791b038
commit
224e592701
@@ -1,9 +1,9 @@
|
||||
To try it out, **you must build the SDK first** and then host this folder:
|
||||
|
||||
```
|
||||
$ npm run build
|
||||
$ yarn build
|
||||
$ cd examples/browser
|
||||
$ python -m SimpleHTTPServer 8003
|
||||
$ python -m http.server 8003
|
||||
```
|
||||
|
||||
Then visit ``http://localhost:8003``.
|
||||
|
@@ -1,11 +1,7 @@
|
||||
console.log("Loading browser sdk");
|
||||
|
||||
var client = matrixcs.createClient("https://matrix.org");
|
||||
client.publicRooms(function (err, data) {
|
||||
if (err) {
|
||||
console.error("err %s", JSON.stringify(err));
|
||||
return;
|
||||
}
|
||||
var client = matrixcs.createClient({baseUrl: "https://matrix.org"});
|
||||
client.publicRooms().then(function (data) {
|
||||
console.log("data %s [...]", JSON.stringify(data).substring(0, 100));
|
||||
console.log("Congratulations! The SDK is working on the browser!");
|
||||
var result = document.getElementById("result");
|
||||
|
Reference in New Issue
Block a user