OneNote API Capture webscreenshot - onenote

I am facing a challenge in One Note API web screenshot API, I am posting a reqest as mentioned below but for few content URL it is rendering as a file icon in one Note web application
--NewPart
Content-Disposition: form-data; name="Presentation"
Content-Type: application/xhtml+xml
<html>
<head>
<title>Example 2</title>
<meta name="created" content=2016-06-22/>
</head>
<body>
<div><img data-render-src=https://content.connect.connect-uat.co.uk/Content/UAT/ElektraMedia/Maths_Y7/MF_1.1/Contents/Ch02/1/example2.html width=700 /></div>
</body>
</html>
--NewPart--
kindly suggest me if any thing wrong in the web screen shot rendering?

I tried your request with the OneNote ApiGee Console and I was able to get the page created in my notebook.
Here is the request I tried -
--NewPart
Content-Disposition: form-data; name="Presentation"
Content-Type: application/xhtml+xml
<?xml version="1.0" encoding="utf-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us">
<head>
<title>Page from OneNote API console</title>
<meta name="created" content="2014-03-17T09:00:00-08:00" />
</head>
<body>
<div>
<img data-render-src=https://content.connect.connect-uat.co.uk/Content/UAT/ElektraMedia/Maths_Y7/MF_1.1/Contents/Ch02/1/example2.html width=700 />
</div>
</body>
</html>
--NewPart--

Related

loading Instagram into frame

how to load instagram page into frame.
The code that I wrote below blocks the page of instagram
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<iframe src="https://www.instagram.com"></iframe>
<button> Start </button>
</body>
</html>
Short answer: you can't.
Long answer: instagram uses the HTTP header x-frame-options: SAMEORIGIN, so the web browser will not show the page in a <iframe> tag.

In Firefox, getting error in console "XML Parsing Error: mismatched tag" for input

I am getting the following error when opening up my page in Firefox (other browsers don't show this error). I am using HTML5 and if I try to put closing tags on the input, then the page fails validation.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" >
<!--... more here...-->
</head>
<body>
<!--... more here...-->
<input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF">
<!--... more here...-->
</body>
</html>
Edit 1: Firefox version is latest (59.0.2 (64-bit))
Edit 2: Response headers:
Cache-Control max-age=604800, public
Connection Keep-Alive
Content-Type text/html; charset=UTF-8
Date Tue, 24 Apr 2018 16:04:19 GMT
Keep-Alive timeout=5, max=100
Server Apache/2.4.6 (Red Hat Enterpri…penSSL/1.0.2k-fips PHP/5.6.35
Strict-Transport-Security max-age=31536000; includeSubdomains;
Transfer-Encoding chunked
X-Powered-By PHP/5.6.35
Because your <input>has no content allot of times people do not close the tag <input></input> but in your case close it at the end of it like so <input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF"/>
Please try the following,
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" >
<!--... more here...-->
</head>
<body>
<!--... more here...-->
<input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF"/>
<!--... more here...-->
</body>
</html>
Hope this helps
It seems the Firefox version issue. I have tried that code snippet in Firefox 43.0.1 and found OK. You can please update the Firefox version.
TL;DR Your browser is reading your html in an older format
EDIT:
I'd like you to try two more things
In Firefox, select View Page Info from the context menu, and look for Render Mode.
Update to Firefox beta 60 Help -> About Firefox -> Update
It would seem that your browser is reading your code in the XHTML format which requires strict tags among other things. Ensure that your firefox is up to date, and also replace this line:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
with this:
<meta charset="utf-8">
Reason:
This is another element that’s been simplified since XHTML and HTML4, and is an optional feature, but recommended. In the past, you may have written it like this

Why HTML page downloaded as file by browser, not browsing instead?

I used next HTML code as page, but Chrome just downloaded this page as file, not browsed as hypertext instead.
Address used: http://127.0.0.1:5151/
What's wrong with it?
<!DOCTYPE html>
<html lang="en" xmlns="">
<head>
<meta charset="UTF-8">
<title>Greeting</title>
</head>
<body>
<h3>Greetings!</h3>
Welcome to the Web Interface.<br/>
<br/>
What action are you want to do?<br/>
<br/>
1. Upload config<br/>
</body>
</html>
Headers used Content-Type: application/xhtml
Check if the file extension is .html instead of .hmlt or something else

how to retrieve URL into GSP

i am trying to show a content in iframe..it works at localhost
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><g:message code="default.list.label" args="[entityName]"/></title>
</head>
<body>
<div class="body">
<iframe style="width: 100%;min-height: 400px;height: 600px" src="https://www.google.com" />
</div>
</body>
</html>
but when i build a war and deploy it to server...that page was blank?
why?
Because Facebook doesn't allow it:
curl -v https://www.facebook.com
...
< X-Frame-Options: DENY
...
With DENY value:
The page cannot be displayed in a frame, regardless of the site
attempting to do so.
Google and many other sites have similar configuration, so please check for header. Also, you could open Chrome Developer Console, and check for errors
See docs for this header: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header

Valid html 5 sample

I'm looking for an html 5 document in xml format that is considered valid by these tools:
eclipse juno html validator
w3c validator http://validator.w3.org
http://html5.validator.nu/
firefox html validator https://addons.mozilla.org/fr/firefox/addon/html-validator/
Can anyone provide me such a document if it exists or explain me which validator aren't conform to the standard. The best I've found is the following document:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
dir="ltr">
<head>
<meta name="description"
content="application/xhtml+xml; charset=UTF-8" />
<title>Get an object</title>
</head>
<body>
<section>This is a section</section>
</body>
Note that document contains a section element which is only valid in html 5. This document isn't valid for eclipse and firefox.
Regards,
Mickaël
Answer:
Thanks for your useful link igo: http://docs.webplatform.org/wiki/html/tutorials
I learnt that even if using xhtml syntax is highly recommended, including the xml header line may cause problems to some browsers. So I removed it and the following code is validated by all validators above, eclipse validates it as html5 using xml constraints.
<!DOCTYPE html>
<html lang="en"
dir="ltr">
<head>
<meta name="description"
content="application/xhtml+xml"/>
<meta charset="UTF-8"/>
<title>Get an object</title>
</head>
<body>
<section>This is a section</section>
</body>
</html>
check the documentation on new launched web from W3C at https://www.w3.org/QA/2002/04/valid-dtd-list.html