BluePhoenixNC Posted August 11, 2006 Share Posted August 11, 2006 My appologies, I am not a JS junkie and just starting out with the whole thing so please be patient with me.I was wondering if it is possible to create an iframe in Javascript dynamically. have it load a certain page based on a variable and, assign the iframe a CSS class (which is to determine the height and width of that frame as opposed to have to go through the js code and change those attributes) and place the whole thing into a specified div container. here is what I had so far:[code]function createFrame(url) { var placeDIV = document.getElementById("placeme"); var xIFrameElement = document.createElement("iframe"); xIFrameElement.frameBorder = 0; xIFrameElement.name = "someFrame"; xIFrameElement.id = "someFrame"; xIFrameElement.class = "frameclass"; //not sure about that one if this is valid xIFrameElement.location = url; //not sure either placeDiv.appendChild = (xIFrameElement);}[/code]But it just does not 'activate' and I am not sure how to proceed.Any help is greatly appreciated.Thanks Link to comment https://forums.phpfreaks.com/topic/17275-javascript-dynamic-iframe-and-location-possible/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.