Skip to content
Advertisement

document.createElement(“iframe”) not working

I inherited some JS code that I was asked to modify to invoke a webpage and insert it into an iframe. I asked this question before and was given a snippet of code that, by itself, does nothing. I inserted it into the JS code but what I am missing is how to get it to execute. I am learning JS so I am sure the answer may be fairly simple. The code I was given is:

JavaScript

Any help in getting the code to execute will be greatly appreciated

Advertisement

Answer

It does nothing because it only declares the prepareFrame function and doesn’t call it.

JavaScript
Advertisement