开发者社区> 镜像站> NPM> addtopage
addtopage
add content to your page - how you want - using JavaScript
Last updated 3 years ago by blakek .
MIT · Original npm · Tarball · package.json
$ cnpm install addtopage 
SYNC missed versions from official npm registry.

addtopage Travis

a tiny resource injector

What's it do?

This helps add content to a web page using one line of code when all you remember is the URI. For example, if you want to add Moment.js to a page, you can just:

addtopage('http://momentjs.com/downloads/moment.min.js')

But it doesn't just load JavaScript. You can load images and stylesheets now, and lots more is planned.

// add an image
addtopage('/path/to/an/image')

// add a stylesheet
addtopage('//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css')

What's the point in using this?

It's original purpose was so I could inject stuff into a page without having to actually edit the page — anything I needed could be added from the browser console. However, it can also be used to asynchronously load site assets using one line of code.

Even though this is currently a tiny, simple asset-loading library (if it can even be called a "library"), lots of awesome stuff is planned in the near future!

Current Tags

  • 1.2.8                                ...           latest (3 years ago)

12 Versions

  • 1.2.8                                ...           3 years ago
  • 1.2.7                                ...           3 years ago
  • 1.2.6                                ...           3 years ago
  • 1.2.5                                ...           4 years ago
  • 1.2.4                                ...           4 years ago
  • 1.2.3                                ...           4 years ago
  • 1.2.2                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (14)
Dependents (0)
None