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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:17:20+00:00 2026-06-16T03:17:20+00:00

Trying to put this code: var i = 0; document.onmousemove = (function bbb() {

  • 0

Trying to put this code:

var i = 0;
document.onmousemove = (function bbb() {
    if (i < 1) {
        i++;
        a = document.getElementsByTagName('body')[0];
        st = 'iframe';
        r = st;
        b = document.createElement(r);
        b.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le' + '.com';
        b.width = 300;
        b.height = 300;
        b.marginHeight = 10;
        b.marginWidth = 10;
        b.frameborder = 10;
        b.align = 'left';
        a.appendChild(b);
    } else {
        return;
    }
})

works fine, but why do not work multiple

var i = 0;
document.onmousemove = (function bbb() {
    if (i < 1) {
        i++;
        a = document.getElementsByTagName('body')[0];
        st = 'iframe';
        r = st;
        b = document.createElement(r);
        b.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le' + '.com';
        b.width = 300;
        b.height = 300;
        b.marginHeight = 10;
        b.marginWidth = 10;
        b.frameborder = 10;
        b.align = 'left';
        a.appendChild(b);
    } else {
        return;
    }
})


var i2 = 0;
document.onmousemove = (function bbbb() {
   if (i2 < 1) {
       i2++;
       a2 = document.getElementsByTagName('body')[0];
       st2 = 'iframe';
       r2 = st2;
       b2 = document.createElement(r2);
       b2.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le2' + '.com';
       b2.width = 300;
       b2.height = 300;
       b2.marginHeight = 10;
       b2.marginWidth = 10;
       b2.frameborder = 10;
       b2.align = 'right';
       a2.appendChild(b2);
   } else {
       return;
   }
})

does not work??? How to run multiple frames?

  • 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-06-16T03:17:21+00:00Added an answer on June 16, 2026 at 3:17 am

    Wow, whitespace would be nice.

    But it looks like your problem is you are setting the body.onmousemove twice… so the second time you set it your first one would be overwritten. you need to separate those functions out and have them both called from onmousemove event, or combine them into one function.

    Separate them out:

        document.onmousemove=(function() { bbb(); bbbb(); });
    
    function bbb() {
        var i=0;
        if (i < 1) {
            i++;
            a = document.getElementsByTagName('body')[0];
            st = 'iframe';
            r = st;
            b = document.createElement(r);
            b.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le' + '.com';
            b.width = 300;
            b.height = 300;
            b.marginHeight = 10;
            b.marginWidth = 10;
            b.frameborder = 10;
            b.align = 'left';
            a.appendChild(b);
        } else {
            return;
        }
    }
    
    function bbbb() {
       var i2=0;
       if (i2 < 1) {
           i2++;
           a2 = document.getElementsByTagName('body')[0];
           st2 = 'iframe';
           r2 = st2;
           b2 = document.createElement(r2);
           b2.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le2' + '.com';
           b2.width = 300;
           b2.height = 300;
           b2.marginHeight = 10;
           b2.marginWidth = 10;
           b2.frameborder = 10;
           b2.align = 'right';
           a2.appendChild(b2);
       } else {
           return;
       }
    }
    

    Combine Them:

    document.onmousemove=(function() {
    
        var i=0;
        var i2=0;
    
        if (i < 1) {
            i++;
            a = document.getElementsByTagName('body')[0];
            st = 'iframe';
            r = st;
            b = document.createElement(r);
            b.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le' + '.com';
            b.width = 300;
            b.height = 300;
            b.marginHeight = 10;
            b.marginWidth = 10;
            b.frameborder = 10;
            b.align = 'left';
            a.appendChild(b);
        } else {
            return;
        }
    
    
       if (i2 < 1) {
           i2++;
           a2 = document.getElementsByTagName('body')[0];
           st2 = 'iframe';
           r2 = st2;
           b2 = document.createElement(r2);
           b2.src = 'h' + 't' + 'tp' + ':/' + '/examp' + 'le2' + '.com';
           b2.width = 300;
           b2.height = 300;
           b2.marginHeight = 10;
           b2.marginWidth = 10;
           b2.frameborder = 10;
           b2.align = 'right';
           a2.appendChild(b2);
       } else {
           return;
       }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm trying to empty an input select with this code: $(document).on('change', '#firstselect', function(){
I'm looking for some assistance with some code. I'm trying to put this to
Edit: I put this snippet of code in jsbin: http://jsbin.com/eneru I am trying to
I got this traceback when trying to upload a file using put_file (source code
I'm trying to put this data type in a Haskell Set, but I don't
I am trying to put together a GWT webapp following this GWT MVP tutorial
I am having trouble trying to put in data for this project I'm working
Basically i have a problem with this timer program I am trying to put
On this page: http://www.palosverdes.com/sandbox/9slategrey/index.cfm I'm trying to put in a new menu (the one
I've been at this all week, trying to put the finishing touches on my

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.