I am developing a widget. the code for it is :
<script type="text/javascript">
var hashgurus_woeid = 1;
</script>
<script src="../feed/livetrend.js"></script>
livetrend.js contains:
var _html = '<div id="FJ_TF_Cont" style="position: relative; padding: 20px; margin: 20px; border-width: 0px; width: 200px;">'
+ '<iframe width="210" height="640" src="../feed/default.aspx?woeid=' + hashgurus_woeid +'" '
+ 'name="FJIframe" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" style="width: 210px; border-width: 0px; z-index: 1;">'
+ '</iframe>'
+ '</div>';
document.write(_html);
test html page:
I created a test html page and put the widget in it. It perfectly works. Now the whole problem is when i add the async attribute. i donot see any output.
<script type="text/javascript">
var hashgurus_woeid = 1;
</script>
<script async src="../feed/livetrend.js"></script>
what is the problem ? is it because of the document.write ?