Using Angularjs Variable Inside Iframe
So I want to use a variable inside a iframe src or ng-src attribute. Apparently none of my variables get ever recognized, whatever I use. For example `
Solution 2:
You can set the src property with this syntax:
iframeObject.src = URL
To note: URL specifies the URL of the content to embed and it can be either an absolute or a relative URL.
Example:
document.getElementById('embedContent').src = "http://www.example.com";
#embedContent{
width: 600px;
height: 500px;
}
<iframeid="embedContent"src="#"></iframe>
Because you also want to concatenate / merge two strings, you can just change the JavaScript to
document.getElementById('embedContent').src = "http://www.example.com/?name=" + test;
Post a Comment for "Using Angularjs Variable Inside Iframe"