file not found error in chrome for html code - html

I have been trying to open html file from my desktop folder using chrome. It shows file_not_found it may be deleted or moved. But same is getting open in Edge browser. I'm using windows 10. code written in VS Code editor. Need help. I'm a beginner in programming language.

Install a live-server extension in VS code then you can serve your page from there
You can download from the extensions tab by searching live Server by ritwickdey or
use this link https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer

Related

My Visual- Code-Editor is not showing the included CSS in the Live preview

I just reinstalled windows on my computer. The problem here is that when I was using the visual code editor before reinstalling windows with the live preview extension and it ran perfectly, but now after I installed windows the VC do not give me live preview like before.
It is just showing the HTML structure and not the linked CSS and Javascript files. There is no styling and formatting being shown on the page even though the page displays perfectly on the browser, tried everything but nothing worked. Note that both windows versions are the same no changes in them.[Only HTML shows up][1]
[no definitions found said by vs code editor also]
Yes, it only shows the HTML preview without CSS. You have to use "Live Server" extension for that.
Download that from here:
https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer
GitHub Source:
https://github.com/ritwickdey/vscode-live-server-plus-plus
Preview:
does a .vs code folder appear ? This problem happened to me once and by deleting the file everything went back to normal. IDK if it will work for you but it worked for me.
BTW there is a Youtube video on that topic, here it is a video for CSS files not working on live server

In VS code, whenever I save a file in Html its being saved as Brave Html document when I actually want it to save as Chrome Html doc. How to do it?

Earlier I used to have Brave as my default browser and installed vs code using Brave browser. I then uninstalled vs code and reinstalled it from chrome browser. Still I'm getting the same problem.
Right click then click open with and choose more apps and select chrome then select always open with chrome and tada.

When I try to open .html file in chrome it ocassionally open repository

it divide my html file on 2 different files 1)is repository 2)is just some loading page
same error with pdf files but it divides on 3 files
It works in Firefox.
Google Chrome is set to be my main browser.
Maybe the version of chrome that you use don't support what you're doing but its just my random guess , you can try to use live server of some IDE like VScode and see if the problem persist.

polymer only works when launched with chrome dev editor

It's more of a question of why rather than please fix this. Polymer elements are made for websites, not just chrome apps, right? So why when I open the html file with chrome does it not work but when I run it with chrome dev editor and it opens with chrome does it work? I'd like to build a website using polymer elements, and I'm more than happy to use chrome dev editor, I just wanna know how it'll work if I try to publish.
In order to run a website or webpage that is build with Polymer you will need a server.
Chrome Dev Editor provides a local server when we try to run our code, thus it works from Chrome Dev Editor. However when you open the html file with chrome there is no server set up.
When you run using Chrome Dev Editor you can see in address bar something like this http://127.0.0.1:31999/test/test.html
However when you try opening the html file in chrome you can see in address bar something like this file:///D:/Users/test/test.html
If you don't want Chrome Dev Editor to run your code then you can have local server set up using NodeJS etc. Or use editors like Brackets - it will set up a local server and run your webpage in browser.

How to open a windows folder when clicking on some link on a HTML page using Python

I am writing following program :
***import os
filepath=r'C:\TestData\openfolder.html'
abc=open(filepath,'w')
abc.writelines('<html><head></head><body>')
abc.writelines('First Link\n')
abc.writelines('</body></html>')***
What I want to do is if I click First Link on a browser, I should be able to open the folder having path as "Filepath". os.startfile works perfect for opening a folder but I don't know how to implement this inside some link.
Thanks.
Try to use URI with file: scheme like file:///C:/TestData/openfolder.html in your html:
Link to test data
Here is article on using file URIs in Windows.
UPD (extraction from comments): Each browser has its own way to handle such urls. At least Internet Explorer 8 under Windows 7 opens links in Windows Explorer as was required by jags.
Finally, for dynamic pages the web server is required. If one is needed take a look at discussion on creating simple web services using python.
You can't. Clicking a link to a file in a browser will not launch the application associated with that file type on the OS. You can apparently do some funky stuff with JavaScript to launch particular filetypes with particular applications (see here: http://forums.devshed.com/asp-programming-51/launching-ms-word-to-open-file-from-a-hyperlink-55714.html) but apart from that the web browser is not the file browser.
Link Text
Replace FOLDER_PATH with the path of the folder you want to open in explorer.
Alain's answer works.
<'a href="FOLDER_PATH" target="_explorer.exe">Link Text<'/a>
I removed the tick marks at the beginning and end, and found that it works in
Internet Explorer - opens a Windows Explorer window
Firefox (Windows and Linux), but opens a new tab - same as target="_blank"
Chrome - opens a new tab like Firefox
I also noticed that / and \ (forward and backward slashes) are equal in html links - they can even be mixed.