Javascript DOM

Discussion in 'Programming' started by Acer, Mar 11, 2013.

to remove all ads.
  1. Acer

    Acer New Member

    Messages:
    7
    I have a webpage which adds a floating iframe to the body. I have a javascript function:

    function jettison(){
    var string = prompt('Enter frame name:');
    var newIframe = document.createElement('iframe');
    newIframe.setProperty('src','http://www.blackle.com');
    newIframe.setProperty('seamless','seamless');
    newIframe.setProperty('id',string);
    newIframe.setProperty('unselectable','on');
    newIframe.setProperty('onmousedown','updatePos(event,this)');
    newIframe.setProperty('onmouseout','movePos(event); hide();');
    newIframe.setProperty('onmousemove','movePos(event)');
    newIframe.setProperty('onmouseover','show()');
    newIframe.setProperty('onmouseup','stopPos()');
    newIframe.setProperty('style','position:absolute; left:250px; width:500px; height:500px; top:250px; border:25px black solid;-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;-ms-user-select: none;user-select: none;');
    document.body.appendChild(newIframe);
    alert('Got to end!!!!!!!!!!!!!!!!!!!!!');
    }

    I call the function using a button, and I see the name prompt. I enter in a value, and press OK. However, the Got to end! alert box never appears.

    What is happening that causes Javascript to never get to the end of the function? :confused:

    P.S. You can see my page and source at : http://www.jettison.tk/tests/test3.html
     
  2. leroy30

    leroy30 New Member

    Messages:
    485
    Don't know if this is the cause but it is throwing a 'startx' is undefined error.

    Might need to change 'startx =' to 'var startx ='
     

Share This Page