Drag the background!

API: Webpage

API Version Uses canvas Graphics libraries AB framework Worlds using this API Starter Worlds
Webpage 1.0 No None No 46 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 other APIs).
  • Includes jQuery 3.3.1.

  • 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
157 runs ♦ 0 likes
By Starter user  
Created: 12 Aug 2018
Modified: 1 Oct 2020
Demo of "Web page" API. Just use JS to make a web page. This page gets images from Flickr using ...
Websocket chat
233 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 1 Oct 2020
Demo of Ancient Brain Websockets functionality. Run on multiple devices. Chat from one to the other.
Websocket buttons
38 runs ♦ 0 likes
By Starter user  
Created: 29 Feb 2020
Modified: 1 Oct 2020
Demo of Ancient Brain Websockets functionality. Run on multiple devices. Simple page uses button...

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

Website copyright © Ancient Brain Ltd. 2018-20.
Users retain copyright of their own content.
Ancient Brain ™ is a trademark of Ancient Brain Ltd.

Platforms      Stats      The name      Terms and conditions

Bug bounty      Classes      Contact

Call for partners!
If you are interested in writing a programming course, textbook or tutorial videos, Ancient Brain is looking for partners. We will work with you, and integrate your course into the site. This is an opportunity for someone looking to develop a course or textbook to partner with a site to support it and promote it.