Github page is not showing and keeps loading - html

I have published a Github Pages under this link: https://rochanofa.github.io/unesco-seasia/. It is a web-map application based on OpenLayers library.
However, the content of the page is not showing and the page keeps loading forever.
When I open the index.html file in my local directory the content is displayed on my web browser. Here is the screenshot of the webpage when I load from my local computer.
What could I possibly do wrong?
The link to the repository includes the javascript code: https://github.com/rochanofa/unesco-seasia

Looping redirects
I can't tell where it's coming from in the code, but if you load the page with the network tab open, and check "Preserve log" it appears that the root / redirects to unesco-seasia/ and that page redirects back to /. Normally browsers catch this, but it's using HTTP 307, instead of 302 or 301.

Related

HTML edits not showing

I’m working on a simple webpage with just an index.html file. If I make changes to the html file and then upload the file to my server, when I reload the page using the url with only http the changes I made show, for example, if I remove the index.html file and reload the page it says could not load page, not found. If I do the same thing but use https, the page still loads even if the index.html file is deleted from the server. I have deleted and cleared cache and website data from my iPhone. This seems to happen on iOS in both safari and Firefox on my iPhone but not on a computer. Does the https cache differently or store files in a different directory?

A HTML link redirects to correct URL but page doesn't load and shows 403 error. The page loads fine once the page is refreshed

I have a web application hosted on Apache Tomcat which is installed on XAMPP (XAMPP is an app. like citrix/vmware). On clicking a particular link on the homepage, among many others that work absolutely fine, I'll be redirected to the required URL but the page doesn't load and shows 403 error. However, the page loads fine once the page is refreshed. Also, this error happens only when accessed from XAMPP(where it is hosted; using 'localhost'). This error does not occur when accessed outside XAMPP(using application url). All other links on the homepage works fine in both the cases
ScreenShot of error
Can someone help fix this, please? Any support is much appreciated.

Linking to a Local Page from a Local Sever

I've previously explained that I was trying to link a ejs page to a jade-based app. Then after many failed attempts I tried to convert that page to Jade and still ended up with a truckload of errors. Finally, I thought about simply putting a HTML Link that would redirect me to that ejs page on click.
What I fail to understand though, is why Firefox has no problems displaying the page when I directly put its path in the browser:
file:///home/ghanem/Documents/Project/views/account/el/el.ejs
But when I try to access it from my app through a simple code, it doesn't redirect me to the same very page:
My Stubborn Link
I should also point out that I've already set security.fileuri.strict_origin_policy to false in Firefox.
What I fail to understand though, is why Firefox has no problems displaying the page when I directly put its path in the browser
Because it trusts you
But when I try to access it from my app through a simple code
Your app is "just another website" as far as Firefox is concerned. It doesn't trust it.
I should also point out that I've already set security.fileuri.strict_origin_policy to false in Firefox.
That lets XMLHttpRequest access file:// URLs providing the document it is running in was loaded from a file:// URL.
See mozillaZine: Links to local pages do not work.
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://localhost:7896");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

Accessing a Drive Preview from an iFrame in Chrome via SSL

I have an application that uses Google Drive for document storage and preview functionality, but recently the iFrames that the documents are loading into are not displaying anything. Upon inspection of the console, Chrome declares that it blocked the fram from running insecure content, and that is why the file preview did not load.
The initial call to preview this file is to a url that looks like this:
https://docs.google.com/document/d//preview
There is a redirect along the way that takes the following form but because it uses http instead of https, Chrome blocks the content from loading.
http://www.google.com/url?sa=p&q=https://www.google.com/accounts/ServiceLogin?service%3Dwise%26passive%3Dtrue%26go%3Dtrue%26continue%3Dhttps://docs.google.com/document/d//preview?pref%253D2%2526pli%253D1
Is there any way around this issue? It is blocking a core functionality of my application currently, so any advice would be appreciated. I can provide a screenshot of the full stack of network loads in necessary, but this is the only URL that is not http compliant.
Thanks in advance for your help.
Hacked that. Add a "?pli=1" without quotes at the end of the URL to avoid redirect (after "/preview" or "/edit") and land directly to the document.

Hosting Facebook iframes on pages on Cloudfront

I've switched my Facebook page to pull an iframe as a result of Facebook's recent announcement that they were supporting iframes in pages. Since you need to host the iframe page outside of Facebook, I figured it would be nice to do using Cloudfront to host the files (an HTML page, a CSS stylesheet and a jpg image). Unfortunately, despite setting the permissions on the Cloudfront files to 744, the iframe page loads correctly in a browser, but when called from Facebook, I get this error message.
When I host the same files on my Media Temple server, the iframe on the actual Facebook page also loads correctly.
Is there a reason why Facebook and Cloudfront don't play together? I haven't been able to find one so far.
Unfortunately Facebook loads the iframe page using an HTTP POST, not an HTTP GET and is not compatible since Amazon has a REST interface and properly uses POST to upload/modify content.
Best,
David Bullock
I ran into this problem today and it caused some headscratching. As David Bullock points out the problem is that Facebook loads the HTML page via a POST request but S3 (and thus by extension CloudFront) won't serve resources in response to this (it returns 405 Method Not Allowed).
You can host your CSS, scripts and images on S3 / CloudFront, but the initial HTML page has to be on some other server. If you're concerned about load or latency from across the globe then you could try implementing a tiny redirector that forwards the Facebook POST request to the CloudFront-cached location (you'll have to return 303 See Other to do this redirection so the browser makes a GET request instead: see RFC 2616).
There is a shockingly easy workaround to the fact that AWS rejects POST requests and the fact that Facebook requires page tabs to be hosted via HTTPS: just redirect the request through https://bit.ly/….
Yes, it's really that easy.
Host the HTML page wherever you like. HTTP is fine.
Create a bit.ly-shortened URL to the page.
Use it—substituting https:// for http://—as the "Secure Page Tab
URL" as you create your Facebook Page Tab.
Activate the tab using this highly-undocumented dialog URL: https://www.facebook.com/dialog/pagetab?app_id=app_id&redirect_uri=bitly_url
Boom: done.
OK, it can be done: but you need to host the images on Cloudfront and the rest of the content on S3. Amazon provides a set of clear instructions on how to this. Issue solved.
Use Cloudfront to trap the 405 error and serve your html as the "Custom Error Response" page to the desired index page
Updated:
This was down voted, however I'm going to help lots of Facebook developers with the following. The final Issue that we had with hosting a facebook application on S3 was with CORS. We fixed the 405's by doing a "Custom Error Response" See this link for details:
http://blog.celingest.com/en/2014/10/02/tutorial-using-cors-with-cloudfront-and-s3/