RE: Access content inside an inframe from the current gorm Viji Ram 5.Nov.18 04:12 AM a Web browser Applications Development All ReleasesAll Platforms
Hi Tyler, thank you for answering. I tried by googling. But if the content which is loaded inside an iframe is a html file, my code works fine. If its a notes web form, the code breaks. I have posted my code. Please help me to check where am missing.
<script type=“text/javascript”>
$(document).ready(function(){
var iframe1=document.getElementById(“myframe”);
var h1=iframe1.contentWindow.document.getElementsByTagName(“h1”)[0];
alert(h1.textContent);
var iframe2=document.getElementById(“myframe2”);
alert(‘msg1’);
var iframedoc=iframe2.Document;
alert(‘msg2’);
var iframeForm=iframedoc.getElementById(“iframeform”);
alert(‘msg3’);
var yourname=iframeForm.yourname.value;
alert(‘msg4’);
});
</script>
Design element 2:html file in lotus notes
Name :dummy.html
<html>
<head>
</head>
<body>
<h1>This is h1 tag</h1>
<p>welcome </p>
</body>
</html>
Design element 3:form
Name:iframeform
<div>
<h1 id=“h1tag”>this is in iframe form</h1>
<h2>yourname<h2> /*here yourname is a lotus notes field with id as yourname */