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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.