email iframe content

Discussion in 'JavaScript' started by mlsherrod, Sep 1, 2007.

  1. #1
    It's simple enough to have a browser pop up a new email with mail to:, and add a subject and link to a web site. However, I have jumped ship into a totally iframed served site, and am interested in getting an email script that will imbed either the url of the iframe or the iframe itself if there is any easy work around on this, I appreciate being pointed in the right direction.

    I would assume being able to do both would be preferrable. I appreciate any help. thanks!
     
    mlsherrod, Sep 1, 2007 IP
  2. DorianG

    DorianG Peon

    Messages:
    15
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can extract the iframe's location like this

    alert(window.frames['frame_name_here'].location);
    or
    alert(window.frames['0'].location); if there is only one iframe

    is this what you wanted?

    DorainGreat
    http://qleeq.com
    free/open source software
     
    DorianG, Sep 2, 2007 IP
  3. mlsherrod

    mlsherrod Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yeah, that will call upon the frame (we'll call it iframe1)

    I'm basically looking to add this into a script, where would I include this call upon the iframe to include it within the email body?

    <SCRIPT TYPE="text/javascript"><!--

    var SubjectLine=' '+top.document.title;
    var BodyText='You can see this page at: '+top.location.href;

    var Message='<A CLASS=contact HREF="mailto:?SUBJECT='+escape(SubjectLine)+'&BODY='+escape(BodyText)+'" OnMouseOver="status=\'Envoyer cette page à vos amis\'; return true;" TITLE="Send your friends e-mail about this page">email<\/A>';

    var MessageIE='<A CLASS=contact HREF="mailto:?SUBJECT='+(SubjectLine)+'&BODY='+(BodyText)+'" OnMouseOver="status=\'Envoyer cette page à vos amis\'; return true;" TITLE="Send your friends e-mail about this page">email<\/A>';
    if(document.all) { document.write(MessageIE); }
    else { document.write(Message); }
    //--></SCRIPT>
     
    mlsherrod, Sep 2, 2007 IP