Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys ,
my issue is started when my company decided to offer for all employees to prepare for Microsoft digital literacy Exam , my problem that I need to save all employees result into sql server database.
Exam link is : Digital Litercy Exam

that is a free exam from microsoft , I found that the best way to do it via html Iframe , I couldn't capture innerhtml for that iframe .

please help me in Iframe or any alternative way ..

PS: I need to get that last page result only which it has different address .

What I have tried:

I tried this:
HTML
<pre>/ <iframe id="myFrame"       src="https://www.microsoft.com/about/corporatecitizenship/citizenship/giving/programs/up/digitalliteracy/asmt/assessment.aspx?lang=eng&amp;aid=as26b" width="100%" height="800"></iframe>

and
JavaScript
<pre>      <script type ="text/javascript" >

          document.getElementById('myFrame').onload = myFunction();

          function myFunction()
          {

              var y = document.getElementById('myFrame').contentWindow.document.body.innerHTM;
              document.getElementById('txt1').value = y;
          }

      </script>


what i missed !!

Thanks a gain :)
Posted
Updated 25-Nov-17 17:09pm

1 solution

I'm afraid it might not be possible to render the page in an Iframe within your company domain. The Microsoft.com domain has the x-frame-options set to sameorigin. Someone can verify this, please.

Scan results for www.microsoft.com[^]

SAMEORIGIN
The page can only be displayed in a frame on the same origin as the page itself. The spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain.

X-Frame-Options - HTTP | MDN[^]
 
Share this answer
 
Comments
Dave Kreskowiak 25-Nov-17 23:53pm    
You are correct. It cannot be displayed in an iFrame.
F-ES Sitecore 26-Nov-17 8:28am    
Even if it could be displayed the code in the parent page couldn't access it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900