Why I can't develop single html page with linked css or js files? - google-chrome

What is wrong with Chrome? I want to develop just a single html page. Without any server. Just one page. I know that I need web-server for using that page. But I need to just create a short simple html page with linked js and css files. And I can't do this, because chrome is too smart and I get the same error from chrome:
Not allowed to load local resource
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>ACAB</title>
<script type='text/javascript' src="./data_statistic.js"></script>
....

Related

How to access non-home page in Amplify

I'm trying to learn to use AWS Amplify. When I just use the index.html file it runs fine.
But when I try to access a non-home page via a link from the main Amplify page (on AWS) I get an error (below). All the code is just html. (I'm trying to keep it simple while I attempt to learn how to work with AWS Amplify.)
This file runs just fine.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AWS Amplify Test</title>
</head>
<body>
</body>
</html>
But I cannot run the next file.
<html>
<head>
<meta charset="UTF-8">
<title>AWS Amplify Test: About</title>
</head>
<body>
</body>
</html>
The following file does not run. Instead I get this error message:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>9AE4WZ4KDMAXGAF0</RequestId>
<HostId>+Jk4OYPdxus7Nd/wT1vQ5Oi4bNRCUr56nzVjFiSlHxixpvJiFboB74A7258PCv4RUrSD8JIQPak=</HostId>
</Error>
I followed (I think) the same steps I used with the Index.html file: Run WinZip and copy it into the Amplify screen.
TWO QUESTIONS:
Why does this error occur and how can I fix it?
How, in general, can I have a simple html file with several files linked to it via menu options?
Thanks for any help. It will be much appreciated, while I stumble around as a beginner.

Chrome is downloading HTML files instead of displaying them

I need some help. I decided to create a home FTP server for my family. I hit a roadblock a few hours ago. When I was creating my home page, I wanted to test it in Chrome. I linked a css file to it aswell. I expected to see the test webpage, which was a h1 with the text hello. What actually happened was the fact that it downloaded my html file, and when I opened that in Chrome, I saw my page without the css. I've tried everything to speak of on this site and I even checked page 2 of Google. Here's my code, I'm running FTP on IIS 10.
<!DOCTYPE HTML>
<html>
<head>
<title>Home</title>
<link rel="stylesheet" href="main.css">
<meta http-equiv="Content-Type" content="text/html">
</head>
<body>
<h1>Hello!</h1>
</body>
</html>
As far as I know, chrome download the html page is right. Since you use chrome to access a ftp file, it is not a http connection to the server. The chrome will not directly show it.
If you want to show the html page in the browser, you should use IIS website instead of ftp site.
More details about how to create a IIS web site, you could refer to below article.
https://support.microsoft.com/en-sg/help/323972/how-to-set-up-your-first-iis-web-site
i guess you are putting it in a wrong format
as https://www.w3schools.com/css/css_howto.asp says
<link rel="stylesheet" type="text/css" href="mystyle.css">

Page redirection not working unless I add .html to the URL

I had a client that gave a URL in a press kit before the website was done. He gave a page when I was making the website a one page site. So I took the URL he made and coded it as a redirect to scroll to that part of the site.
Now that I have it online, it isn't working properly.
fuzzripper.com/bio gives me an internal server error
fuzzripper.com/bio.html works just fine
I would like it to work even if the user doesn't type .html
Here is my redirect code
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=http://www.fuzzripper.com/#about">
<script type="text/javascript">
window.location.href = "http://www.fuzzripper.com/#about"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow this <a href='http://www.fuzzripper.com/#about'>link</a>.
</body>
</html>
A quick fix for static sites is to
Create a /bio folder
Move bio.html in bio folder
Rename bio.html to index.html
This should make the bio#about link work just fine.

Creating page API (through Graph) does not work

I'm trying to create pages using the beta API for OneNote (through Graph). Even though I've completely emptied out my OneNote (no notebooks), I still get 20117 - An item with this name already exists in this location. I've tested and I can create a Notebook just fine through this, but pages just refuse to be created (oddly enough, a default Notebook and Section will be created, but the page won't)
The URL I'm sending the POST to is: https://graph.microsoft.com/beta/me/notes/pages?sectionName=Quick%20Notes
The HTML content for the page I'm providing is:
<!DOCTYPE html>
<html>
<head>
<title>Testing Page</title>
<meta name="created" content="2015-07-22T09:00:00-08:00" />
</head>
<body>
yeaaaah
</body>
</html>

Direct downloading link in browser opening file instead of downloading it

I am trying to create a html simple website on IIS that will help downloading files.
<!doctype html>
<html lang="en">
<head>
</head>
<body>
Start automatic download!
</body>
</html>
This is running file. On clicking "Start automatic download!" it is downloading newUpdater.xml in browser. But, If I directly give this download link in browser (below), it is opening the XML file in all browsers(chrome, firefox).
http://169.254.68.202/newUpdater.xml
Any Idea How to fix this. I think this is possible as
http://dl.google.com//googletalk//googletalk-setup.exe
this link on browser will start downloading gtlk directly.