Drag the background!

API: Webpage (r2)

API Uses canvas Graphics libraries AB framework Worlds using this API Starter Worlds
Webpage (r2) No None No 76 Worlds Starter Worlds


This API is for Worlds with no canvas. That is, the World is a web page with regular HTML elements.

This site is mostly about uploading JS (not HTML) to make a World which normally "runs" on a canvas element on a page. This API is different to the other APIs. It allows you make a World with no canvas.

This API has the following features:

  • It gives you a blank page, and you use JS to insert whatever HTML and CSS and data you want on the page.
  • Your World can just document.write HTML and CSS into the body.
  • The API sets a page title.
  • There is no run header, so as not to interfere with your page layout.
  • You reload and close the page like any other tab.
  • Links on the page open in the same window (not in a new window like in the canvas APIs).
  • Includes jQuery 3.6.0.
  • Loads up minimal CSS that should not conflict with user CSS.

  • The style of the blank page is a body with margin 0 and padding 0. You can change it using JS like this:
     
      $('body').css( "margin", "20px" );
      $('body').css( "padding", "20px" );
    

Screenshots:

  • The screenshot does not assume there is a canvas. Instead it takes a screenshot of the HTML.
  • It uses the html2canvas library to build a screenshot of your page using JS.
  • The html2canvas library has some limitations and may not be able to accurately screenshot your page.

Templates


Examples

Examples of Worlds that use this API:


Flickr World
192 runs ♦ 0 likes
By Starter user  
Created: 12 Aug 2018
Modified: 18 Apr 2021
Demo of "Web page" API. Just use JS to make a web page. This page gets images from Flickr using ...
Websocket buttons
184 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 4 Jul 2021
Demo of Ancient Brain Websockets functionality. Run on multiple devices. Simple page uses button...
Test Websockets
81 runs ♦ 0 likes
By Starter user  
Created: 14 Nov 2022
Modified: 14 Nov 2022
Test if Websocket server is up
Websocket chat
765 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 12 Jan 2023
Demo of Ancient Brain Websockets functionality. Run on multiple devices. Chat from one to the other.
Password Websock...
24 runs ♦ 0 likes
By Starter user  
Created: 14 Nov 2022
Modified: 15 Nov 2022
Password only Websocket world (web page version). Need to enter password. Only join with users w...

The background is a program, showing the JavaScript graphics used on this site.
The globes light up when you log in.
 
Font:

Users retain ownership of user content.

Platforms      Stats      The name      Terms and conditions

Call for partners      Contact

Call for partners!
Ancient Brain is looking for partners. In particular, we seek a partner in writing a JavaScript coding book for schools, to be used worldwide. We will integrate your course into the Ancient Brain site. This is an opportunity for someone looking to develop a course and textbook to partner with a site to promote it. Read more.