Posts

Dear Open Hub Users,

We’re excited to announce that we will be moving the Open Hub Forum to https://community.synopsys.com/s/black-duck-open-hub. Beginning immediately, users can head over, register, get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.


On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at [email protected]

Feedback Forum : Widget cannot load asynchronously

This issue was a problem for my web site too, by slowing down page loads or even blocking the page load at some point. I don't understand why OpenHub hasn't updated their widgets to support async. I ... [More] found a simple work-around for this issue: <html> <body> <!-- we want to display the widget here, but load it when all else in the page was loaded --> <a><span id=openhub-widget-target></span></a> <!-- the rest of the page goes here --> <!-- hack for the synchronous openhub widget script --> <span hidden id=openhub-widget-source><script type=text/javascript src=https://www.openhub.net/p/gsoap/widgets/project_thin_badge?format=js> </script> <script>document.getElementById(openhub-widget-target).innerHTML = document.getElementById(openhub-widget-source).innerHTML</script></span> </body> </html> This places the OpenHub widget script at the very end of the page in a hidden span and then runs a script that copies the HTML populated by the widget's document.write() to the place in the document where we want it. PS. I couldn't get this post not to mess up with HTML tags, so used &lt; to replace < Hope this helps. Robert van Engelen [Less]

Views
Author
Posted
494
over 6 years ago