javascript - I want to create a widget which will render an application on sites who add that Widget to their webpage -



javascript - I want to create a widget which will render an application on sites who add that Widget to their webpage -

i want create widget or javascript code render html form on webpage code embedded.

eg. www.example.com wants show bmi calculator hosted on www.example2.com example2 wants share bmi example.com not giving actual code. share js code ( how include google analytics or google ads ). whats best way accomplish this?

in calculator asking multiple details user saved in database on www.example2.com in db .

i don't want go java applet or flash way. have share html code of bmi calculator not ideal.

what possibilities here.

thanks

there 2 ways this: iframe , javascript.

the more mutual way utilize iframe, simple webpage on have total control. more, best advantage iframe loaded asynchronously loading of page isn't affected loading of widget.

this approach facebook uses , does, other major sites utilize same approach.

as pointed out in comments, using iframes permits utilize cookies, load css, javascript, ecc total webpage.

to utilize iframes have utilize code this:

<iframe id="widgetcontent" src="http://example.com/widget/id" frameborder="0" height="600"></iframe>

it's simple!

javascript php widget

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -