Jquery method for obtaining the iframe src attribute value, jqueryiframe
Get the value of the iframe src attribute:
Html code
<!DOCTYPE HTML>
How does js obtain its own iframe attribute?
Var tableName = window. parent. frames ["mainFrame"]. tName; // get the parameter value of the parent page
Window. parent. frames ["mainFrame"]. getPageInfo (); // method of the parent page
Var divValue = window. parent. $ ("# test"). text (); (jQuery); // obtain the text value of the parent page div
Var htmlUrl = window. parent. $ ("# main_frame"). attr ("src"); (jQuery) // obtain the src attribute value of iframe on the parent page
You are var id = window. parent. frames [0]. id;
How does jQuery assign values to the src of iframe?
Assume that the id of your iframe is "iframeId" and the value to be assigned is value.
<Script type = "text/javascript">
$ (Function (){
$ ("# IframeId"). attr ("src", value );
});
</Script>