Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Embdes #310

Open
Restuta opened this issue Nov 10, 2017 · 1 comment
Open

Improve Embdes #310

Restuta opened this issue Nov 10, 2017 · 1 comment

Comments

@Restuta
Copy link
Owner

Restuta commented Nov 10, 2017

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();

})();
@Restuta
Copy link
Owner Author

Restuta commented Dec 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant