emma57573 Posted April 10, 2009 Share Posted April 10, 2009 First I should explain that I dont normally write JS, I normally leave and js to code snippits, so this is new to me. So I have a dynamic Iframe and I want to call it for javascript so it can be used as a widget for blogs etc This is what I have: <script src="http://www.mydomain.com/widget_script.js" type="text/javascript"></script><script type="text/javascript">new widget.Promo(205, 188,0,0,3).renderIframe();</script> and the JS: widget = typeof(widget)=="undefined" ? {} : MISImini; widget.Promo = function(user_id, width, cid, order, qty) { this.user_id = user_id; this.width = width; this.cid = cid; this.order = order; this.qty = qty; } getURL: function(){ return 'http://www.mydomain.com/widget.php'+ '?user_id='+this.id+ '&width='+this.getWidth(); '&cid='+this.cid+ '&ord='+this.order+ '&qty='+this.qty+ }, var html = '<iframe id="promo_iframe" name="promo_iframe" allowtransparency=true style="width:100%;height:200px" src="'+this.getURL()+'" scrolling="no" frameborder="0"></iframe>'; document.write(html); } Nothing happens, the iframe does not load :-\ Quote Link to comment https://forums.phpfreaks.com/topic/153450-solved-iframe-widget-not-loading/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.