Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6893419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:39:22+00:00 2026-05-27T06:39:22+00:00

I am trying do some modification to an greasemonkey userscript to implement a feature

  • 0

I am trying do some modification to an greasemonkey userscript to implement a feature I need. The code is like

showAddress:function(addrString,type)
{
        this.addrBox=$('<div id="batchPublish"></div>')
        .append('<div id="batchHeader"></div>')
        .append('<div id="batchContent" style="float:left;clear:both"></div>');

   .........

 var batchContent=this.addrBox.find('#batchContent')
        .append('<pre width="300" style="text-align:left" id="batchedlink"></pre>'); 

         this.addrBox.find('#batchedlink').css({'width':'500px','height':'250px','overflow':'auto','word-wrap': 'break-word'})
        .append(addrString); 

        $.blockUI({message:this.addrBox,css:{width:"520px",height:"300px"}}); }

Basically this code writes data to html. What I want to implement is to have “addrString” written to an iframe embedded. Now It’s in the “pre” tag. I have tried many approaches but still no luck. Iframe was always empty.
I am completely a novice in javascript and unclear whether this is possible.

Thank you for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:39:23+00:00Added an answer on May 27, 2026 at 6:39 am

    Since you are adding the iFrame in the same domain, then you can manipulate its contents like this:
    (See it in action at jsBin.)

    $("#batchContent").append ('<iframe id="batchedlink"></iframe>');
    
    /*--- Compensate for a bug in IE and FF, Dynamically added iFrame needs 
        some time to become "DOM-able".
    */
    setTimeout ( function () {
            var iframeBody  = $("#batchedlink").contents ().find ("body");
    
            iframeBody.append (addrString);
        },
        333
    );
    

    NOTE:
    For a Chrome userscript, you apparently don’t need the timer delay. But for FF and IE 8 (the other 2 browsers I double-checked), a dynamically added iFrame is not manipulable until after it has “settled” for some reason. This seems to take about 200 mS.

    A statically loaded iFrame does not have this lag, see the jsBin demo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I was trying some practice programs in python and I came across this
I'm trying to implement the times() function in C programming. I'm using the struct
I'm trying to post some code snippets on my WordPress blog, but when I
I am trying to implement some MVC-style UI components in Flex 4. I want
I’m thinking about trying some development for the iPhone, is it possible to install
I'm trying some of the ASP.NET MVC tutorials and one of them has the
I am trying some way to optimize following sql statement: exe_sql DELETE FROM tblEvent_type
I have been trying some programs in the C Language and come across to
I was trying some problems with my 2D ruby array and my LOC reduces
I'm a beginner C++ programmer, and to stretch my mind I've been trying some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.