Easiest way to deploy an html page on a web server - html

I have an html file that I use to extract a locally stored sqlite database file's informtaion, using some easy javascript.
Now I want to access this web page through http protocol (not file:/// scheme).
What configuration do you recommend to easily realize this manoeuvre ?
Thank you in advance.

Your question is lacking, but in general you want a webhost or setup your own computer for external connections.
I recommend finding a simple hosting site and learning the procedure from there.

From the command line, navigate into your project folder, and run:
python -m SimpleHTTPServer
You can then open http://localhost:8000 in your browser, to view your page using the http:// protocol.
(I don't think this will work if your HTML file is actually PHP, which given that your description includes databases, it sounds like it might be. In that case, I would download something like MAMP.)
This answer assumes you're just trying to use the http:// protocol to test your page locally - like the other solution says, if you want to deploy your page so other people can see it, you'll need to find web hosting.

Related

How to store webpage?

I want to save the following webpage (https://cs231n.github.io/) such that I can easily view it offline. Is there a way to do this without copying each page by hand?
I already downloaded some software but they are not working properly.
I see that there is a GitHub repository, can this be used to offline view the content of the page?
The simplest way is to use third party program as HTTrack. Your linked web-site is relatively simple and this program should handle it.
The hardest yet most correct way is to, yes, clone web-site from git repository and serve it on your local computer. It can be not easy depending on how site is built, does it use database and so on.

Run .EXE From HTML And JS?

I made an project in Visual Studio Express using C#, i compilled it into an .exe, it run normally. is there any way to run my app from HTML, i'm making an website for me.
EDIT: i think is better to make an download and user install the app. thanks for helping :D
No.
You could create a link to the file, and allow people to download it. Their browser may give them a choice to run it immediately or not.
The only I know of to this would be to run an Ajax request and have a server side file execute the file. You can't do it with straight javascript, but if you're willing to use a language like PHP you'll be able to execute a file on your server "using" javascript.

How best to make a web app with multiple pages?

I'm trying to make a multiplatform offline webapp using PhoneGap. I know my html and css, but I'm not altogether familiar with the full capabilities of JavaScript, and I've never made a webapp before, let alone tried to use phonegap to empower it.
Right now, I have the main index.html that phonegap sets up for you, but now I'm uncertain as to how to proceed. If I want a button to take the user to another page from the main page, should I make a second html file and literally link between them, or is this a lot more complex than that?
Also (get ready for a possibly epically stupid question from a total beginner):
Do web apps have to be online? I'm really not clear on whether they function like normal websites in which they need to be hosted on a server, or if they can be packaged up and downloaded just like normal native apps. Please help!
Thanks.
Oh, and btw, I'm working in Xcode with the phonegap addon thing....I'm trying to get it running on the iphone before I move on to android.
Although the other answer helped me at the time, I thought I would add a more complete answer now, five years later, to my own first StackOverflow question.
To start with, a "web app" is the same as a "website" in a technical sense, and yes, they have to be hosted on a server in order to be accessed through the browser...just like every website. The only distinction is that a web app is generally a more dynamic and complex sort of website, involving JavaScript and AJAX. It would be misleading to call a simple website like this one a "web app," whereas Facebook is definitely a web app. Basically all web apps are websites, but not all websites are quite exactly web apps.
However, it only has to be "online" if you want it to be accessible anywhere from a browser via http. If you're making a Cordova app like I was at the time, that's not relevant. If you only want to run an application locally, you can do so with a local server like Python's SimpleHTTPServer or the one webpack provides, or any other alternative, including a server you write yourself from scratch.
As for the primary question about having multiple pages, yes anchor elements like my link are the standard way of connecting pages. To link among your own pages, you would have multiple .html files, and you would create a link with an href like href="myOtherPage.html", where that file is contained in the same directory as the file for the page linking to it. Alternatively you could set up a single-page-app where JavaScript loads new page content without the use of anchor elements-- in that case multiple .html files are not needed. Frameworks like Angular and React are helpful for accomplishing that, but it's by no means necessary.
In a typical web app, most of the time you would just need to create a link as you would if you were creating a link on a website. Also, Web apps can be developed via a local environment (research Mamp/ or Wamp) depending on the dependencies in which your app require.

Includes without local server?

I'm making a website, and I like testing everything offline instead of having to upload files with every change I make. The problem is I can't use includes, so when I do upload, I'm going to have to change a lot of the file structure.
I'm not looking to install a local server like WAMP when I just want to use includes. Is there any way?
Not really.
You could process includes statically (e.g., write yourself a Makefile to create the actual HTML files you view locally). There are plenty of template languages out there that could do this. You could, I suppose, even write your templates in JavaScript and let the web browser assemble them.
But really, why wouldn't you want your test environment to match your production environment? This seems silly—if there is something wrong with your includes, you want to find out before you make it live. If you accidentally get a local path to an image (C:\Documents and Settings\…\image.png) in a file, you want to find out. The best way to do this is really to run a webserver locally.

Creating HTML according to files existence in the file system

I am writing a web application (I am a newbie), where the markup is created by XSL and XML transformations and the style is declared by css files and also some use of JavaScript. I need to create a web page that part of its content is the information on files in a specific directory in the file system.
Any ideas?
Are you talking about the client's file system, or the server's?
If the client's, what you are asking is basically impossible for security reasons without some specific browser plugins/extensions (like a java applet with the right access) - you probably don't want to get into that.
If you are talking about the server file system, you will need some sort of server side language to read the file(s) and return them to browser requests. The sort of things that do that are PHP, ASP.NET, Ruby on Rails, etc...also look into Server Side Includes - that may be sufficient for your needs.
Do you mean the client's filesystem or the server's filesystem? If it's the client's, these tools are inadequate (as access to the client's OS is severely restricted for security purposes). I think most people go with a Java applet for stuff like that.