0

I'm new to IOS Js, i want to add two button to the below iFrame. Then get the click of those buttons. Any help will be appreciated.

                var iframe = document.createElement("IFRAME");
                iframe.setAttribute("src", 'data:text/plain,');
                document.documentElement.appendChild(iframe);
                window.frames[0].window.alert('Please select the area multiplier');
                iframe.parentNode.removeChild(iframe);

If there is any other way to make an iFrame or if i can add a drop down in the iFrame and get the selected item of the drop down. Please let me know

gurmandeep
  • 1,227
  • 1
  • 14
  • 30

2 Answers2

0

When it comes to positioning, general ui widgets have a look at Bootstrap.
W3 have a brilliant tutorial section on bootstrap, you'll be surprised what comes out of the box these days.

Why are you using an iframe?

Heres a few tips which can simplify your code:

var iframe = document.createElement("IFRAME");
             iframe.setAttribute("src", 'data:text/plain,');
             document.documentElement.appendChild(iframe);

If you're using jQuery you could:

var iframe = $('<iframe src="data:text/plain,"></iframe>');
$(document).appendChild(iframe);
iframe.contentWindow.targetFunction().alert('please select the area multiplier');
Rhys Bradbury
  • 1,699
  • 13
  • 24
0

Well i have used a series of divs

 var mainCan=document.getElementById("cont");
 var mainCategoryDiv;
 mainCategoryDiv && mainCategoryDiv.parentNode.removeChild(mainCategoryDiv);
 mainCategoryDiv = document.createElement("div");
 mainVarS(mainCategoryDiv, "position", "absolute", "left", "0px", "top", "0px", "width", 645 + "px", "height", 700 + "px", "backgroundColor", "rgba(32,32,97,0.6)");
 mainCan.parentNode.appendChild(mainCategoryDiv);
gurmandeep
  • 1,227
  • 1
  • 14
  • 30