Jump to content

[SOLVED] IFRAME Widget not loading


emma57573

Recommended Posts

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  :-\

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.