title: Embeddable widgets using jQuery and ASP.NET MVC
body: <p>I need some advice for the best approach to use in developing embeddable widgets that my site users could use to show our content on their site.</p>
  
  <p>Let's say we have some content which uses a <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow noreferrer">jQuery</a> plugin to be rendered, and we want to give our customers an easy way to embed it in their websites.</p>
  
  <p>One option could be of using an IFrame, but as we know this is quite invasive and has some problems. I'd like to know your opinion on that, too.</p>
  
  <p>Another approach could be giving a code like this, to show item #23:</p>
  
  <pre><code>&lt;DIV id="mysitewidget23"&gt;&lt;script src="http://example.com/scripts/wdg.js?id=23" /&gt;&lt;/DIV&gt;
  </code></pre>
  
  <p>And somehow (help needed here...) creating the wdg.js server-side script to inject content, jQuery, needed plugins, inside the DIV.</p>
  
  <p>This looks more promising, since the user can customize to a certain extent the style of the DIV, and no IFRAME is needed. But which is the best and more efficient way to do this in ASP.NET MVC?</p>
  
  <p>There are of course many other approaches to achieve what we need.</p>