Widget - what to do and what not

I would like to create an html / js widget that people can add to their blogs, sites, etc.

I have never done widgets before, so I would like to hear what needs to be done and what is not. For example, how do I make a style? Inline, custom css file or best practice? I believe that I cannot use the head and body in myself. What about h1, h2, etc.? Do they hang a website with widgets or can I use them?

If you have any good tips, I would love to hear them.

Thank.

+3
source share
2 answers

I would try:

  • Make it customizable

    • Download external style sheets?
    • Where can I find the resources I need? (images, style sheets)
    • / ?

    , , , , . , , , .

    • ,
  • .
    • -, , , . , .
    • , , .
    • $, jQuery. Prototype, , , jQuery noConflict-mode,
    • !
      • , - ,
      • , , , .., , , ExampleComWidget . , : ExampleComWidget.addListener('update', callback);
    • ,

      .. example.com, , : com-ex-widget-newsItem

    • ! .
    • , <h1> -tags, SEO. , <h4> . . , , .
+5

JS, . , , -. , css class / id.

0

Source: https://habr.com/ru/post/1735117/


All Articles