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 6634595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:56:54+00:00 2026-05-25T22:56:54+00:00

dv = document.createElement(‘div’); // create dynamically div tag dv.setAttribute(‘id’, lyr1); // give id to

  • 0
dv = document.createElement('div'); // create dynamically div tag
    dv.setAttribute('id', "lyr1"); // give id to it
    dv.className = "top"; // set the style classname
    // set the inner styling of the div tag
    dv.style.position = "absolute";
    // set the html content inside the div tag
    dv.innerHTML = "<input id='serialize01' type='button' value='Serialize' onClick='objSerializeDOM.createXML(),objSerializeDOM.disableSerialize()'/>";

    // finally add the div id to your form
    document.body.insertBefore(dv, document.body.firstChild);

I am using this javascript code to put a button on every page of my domain.I achieve this using GreaseMonkey4IE plugin for IE.But the problem now is that it’s not working for the web pages having frames.

file1.html

<html>
  <head>
   <title></title>
  </head>

  <frameset rows="50%,50%">
  <frame src="friends.html">

  </frameset>

</html>

main.html

<html>
<head>
<title>Joe and Jackie's friends</title>
</head>

<frameset cols="25%,75%">
  <frame src="file1.html">
</frameset>

</html>

friends.html

<html>
<head>
<title></title>
</head>
<body bgcolor="#ccffff">

Joe's friend<br>
<b>Bill</b>

</body>
</html>

When I deploy the above files using tomcat, the button is not showing up.
To deploy :
1.I copied all three html files above and pasted’em inside a fodler named say folder1.
2.Copied folder1 inside webapps folder in tomcat directory.
3.Registered my .js file for domain(i.e,) localhost in GreaseMonkey4IE
4.Hit the URL from browser(IE8) i.e, http://localhost:8080/file1.html (button shows)
5.Hit the URL from browser i.e, http://localhost:8080/main.html (button does not show up.)
I guess whenever there are frames in the web page, it seems the button appended on the web-page get overwritten by the frame . 🙁

Any idea???
Is it by any way possible to get my button displayed ??
Thanks a lot.

  • 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-25T22:56:55+00:00Added an answer on May 25, 2026 at 10:56 pm
    var frameSet = document.getElementsByTagName("frameset");
        if (frameSet[0] != null && frameSet[0] != undefined) {
            var frame = document.createElement('FRAME');
            frame.id = "frame1";
            frame.name = "frame1";
            frame.src = "";
            frameSet[0].rows = "40," + frameSet[0].rows;
            frameSet[0].insertBefore(frame, frameSet[0].firstChild);
            var frame = document.frames[0];
            var currentDocument = frame.document;
            currentDocument.write('<html> <body> <INPUT TYPE="submit" name="btn101" value="Serialize" onClick=""/>  <input id="checkbox101" type="checkbox">IncludeValues</input><br> </body> </html>');
    

    I tried the above code and it worked for me.
    This time I created a new frame and then put my button on it and finally added the frame as the first frame.
    The code provided in the question will work only in case where the web pages don’t have any frame.

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

Sidebar

Related Questions

I have the following javascript: css = document.createElement('style'); css.setAttribute('type', 'text/css'); css_data = document.createTextNode(''); css.appendChild(css_data);
cell = document.createElement(td); cell.setAttribute(colspan, 1); cell.setAttribute(valign, top); var grid = new dojox.grid.DataGrid({ id: gridID,
I have javascript code: function f_dialogOpen() { var e_window = document.createElement(div); e_window.style.position = 'absolute';
Is it possible to create an Iframe using document.createElement(iframe); and then set a variable
On client I create some inputs, for example: var title = document.createElement('input'); title.setAttribute('type', 'text');
I have this code: function render(str) { var main = document.createElement('div'); with(main.style) { //style
I have this code if(!document.getElementById('slider_cmp')) { var toolTip = document.createElement(div); toolTip.className = cmp_tips; toolTip.id
$(div).append($(document.createElement(input)).attr({ 'id': 'post_category', 'value': 'item', 'type': 'checkbox','checked': true })); I am trying to create
I load css var ss = document.createElement(link); var url = 'http://site.ru/style.css'; ss.setAttribute(rel, stylesheet); ss.setAttribute(type,
I want to remove the temporary element which is created dynamically. x = document.createElement(DIV);

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.