1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-05-21 08:53:44 +03:00
matrix-js-sdk/examples/browser/browserTest.js
Kegan Dougal bd202b3193 Remove browser-request dep from examples/browser.
We no longer need this because the dist/ package includes a copy already. This
simplifies browser development a lot.
2015-06-03 16:22:04 +01:00

15 lines
512 B
JavaScript

"use strict";
console.log("Loading browser sdk");
var client = matrixcs.createClient("http://matrix.org");
client.publicRooms(function (err, data) {
if (err) {
console.error("err %s", JSON.stringify(err));
return;
}
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");
result.innerHTML = "<p>The SDK appears to be working correctly.</p>";
});