Open Restuta opened 6 years ago
Currently we use iframes for widgets. (e.g. https://rcn.io/widgets/upcoming-events). I frames are slow and clunky.
See how angel.co does that (no iframes)
<script data-startup="apination" src="https://angel.co/javascripts/embed_jobs.js" id="angellist_embed" async> </script>
(function () { var element = document.getElementById('angellist_embed'); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function(){ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var div = document.createElement('div'); div.innerHTML = xmlhttp.responseText; element.parentNode.insertBefore(div, element); } } var startup_slug = element.getAttribute('data-startup'); xmlhttp.open("GET", "https://angel.co/job_profiles/embed?startup="+startup_slug, true); xmlhttp.send(); })();
Related article https://codeburst.io/building-react-widget-libraries-using-webpack-e0a140c16ce4
Currently we use iframes for widgets. (e.g. https://rcn.io/widgets/upcoming-events). I frames are slow and clunky.
See how angel.co does that (no iframes)