mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-05-21 08:53:44 +03:00
We now rely on browserify for building browser-specific versions of the JS SDK. This can be initiated by running 'npm run build-js'. Node versions are unaffected.
18 lines
600 B
JavaScript
18 lines
600 B
JavaScript
"use strict";
|
|
console.log("Loading browser sdk");
|
|
|
|
// assign the global request module from browser-request.js
|
|
matrixcs.request(request);
|
|
|
|
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>";
|
|
});
|