Вопрос

I would like to development a set of HTML components that can be reused across a set of applications developed by many of our business partners (both internal and external do our domain). For example, I would like to develop a 'graph' widget that takes care of all the details around retrieving data, plotting on a chart and so on. Then a business partner can 'reference' this component and embed it within their web application. I logically visualize this as the partner being able to link to the component and the component returns with all the details in between. Traditional ways of doing this leveraged IFrames but we do not want to utilize this approach for internal reason.

Are there existing frameworks that allow that allow this? I'm aware of all the XSS and it seems it's possible to do if I leverage CORS. Are there other security (or other aspects) I need to be aware of?

To simply the question, is there a way a client can make an http call out to my service, and my service returns HTML fragment (including whatever required css/js needed to render the html).

Thanks in advance.

Это было полезно?

Решение

With pure HTML, this is not possible; HTML is simply a markup language, and is not extensible.

However, XHTML is extensible (see: Developing DTDs with defined and extended modules).

You could also utilize CSS and/or JavaScript files (which your business partner could reference with <link> and <script> elements, respectively), which could modify the appearance (CSS) and behavior (JS) of normal HTML. There are a number of libraries using these techniques already which you could potentially use. For example, Kendo can transform your "normal" HTML elements into something feature-rich.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top