enter image description hereThis is my first post here and i'm looking for getting some help.
I have recently taken courses in HTML/CSS/JavaScript and I feel pretty comfortable in that. Now i'm getting into PHP, and noticed that i need a localhost. I downloaded MAMP, added my website files to the htdocs but I cannot find my index.html in the localhost.
This is what I put in the browser: localhost/htdocs/web-development/Portfolio/index.html
What i'm trying to do is to preview my website and try my registration form which is done with html/css/javascript and php/phpmyadmin.
Even though I can understand and code HTML/CSS/JavaScript and still fairly new to programming so let me know if I explained it a bit messy.
I'm using Atom for coding.
Lukas
The default configuration for MAMP uses ports 8888 and 8889, and 7888, you can see the default port in controle panel under ports
http://localhost:{port number}/{project folder}/index.html -> ( if write php file this could be index.php)
htdocs represents web root that you no need to use in url
Based on your image, your index.html file is in your forms folder, so you have two options:
Move your index.html into your portfolio file and have the server automatically serve it when the address localhost/htdocs/web-development/Portfolio is requested.
Change your URL route to localhost/htdocs/web-development/iPortfolio/forms/index.html
The first would be more in keeping with standards - the server will search for an index.html/php file in the route of a website, which is why people generally use this file for their homepage, as noted here Why do people name their files index.html?
Related
I've just finished a simple game in Adobe Animate using the HTML5 Canvas. I now have .fla, .html and .js files. Can I now put these somewhere on my website to make the game available to play? If so, where? If not, what else do I need? Thanks.
Clicking on the HTML file opens it in a browser, but I can't interact with it.
Thanks.
You're stepping in to a whole new world of hosting and deployments. To have a functioning website you need:
A host server
A domain name
Web files (which you have)
The host server will serve up your web files and allow incoming traffic from the web.
The domain name is optional, but helps with visibility. Without it you'll have to connect directly to the IP address of the host server.
I'd recommend finding a host like HostGator, GoDaddy, or Amazon S3 if you want to host a static website. It can be pretty intimidating at first, but you'll need to put in the time reading documentation to fully understand the process.
Alternatively, if you just want to get it running locally and not on the internet you can install a simple http server on your machine. I use NodeJS so I'll test with http-server alot. Hope this helps!
I followed some instructions,so cesium running locally
and then did hello world example like this
But I cannot see anything when i clicked open in browser. I failed constantly
I don't know what can i do.
From your images, it looks like your Cesium development server is running on port 8080. However, your web browser is simply viewing the local HTML file through its filesystem path (C:\Users\GSY\...) and not through the server. You need to serve your HTML file through http://localhost:8080/ and enter the path to the HTML file relative to where you started the server from. For example, if you started the server in C:\Users\GSY\Desktop, you should try URL http://localhost:8080/helloworld/hello1.html.
I have no idea what your filesystem setup actually is, so you'll need to adjust the URLs based on your system and where you installed things.
However, based on a very quick glance at the Cesium JS quickstart page, you haven't set up your environment properly with an API token, and at any rate you haven't instructed the page to show anything, so it's not surprising the page is blank. I strongly suggest reading through the quickstart examples and looking at the API documentation to understand how to use this tool.
I have a web application that triggers actions at the server side which result in the generation of data files.
The so generated data files are stored within a folder at drive different from the one where the Web application is.
What I tried so far is to create a shortcut (Windows Server) next to the Index.html, where the shortcut points to the folder at the second drive.
This solution does not appear to work:
If I copy the data file to the same folder where the Index.html file is and enter navigate to the URL httm://127.0.0.1:324324/Data_File.xlsx I get the file downloaded.
If I enter httm://127.0.0.1:324324/MyShortcut/Data_File.xlsx (where MyShortcut points to a folder in drive D) the attempt fails.
How can I achieve this?
The need to access files in the different drive is essential.
You need to configure your server to serve that folder under different location. The only reason you are able to see your app and access that folder is cause server is set up to serve it ATM, not because you are making the right calls from the front or cause the front is asking nicely.
Don't know what Windows server version you are using and IIS version that goes on it, or are you even using IIS (you most probably do) but depending on what you use you need to do something in a lines of this:
IIS7 config
What you probably wanna do is create virtual folder in IIS. Try looking into it, then if you fail ask a question with proper tags according where are you stuck.
I don't see how this is connected to front-end at all so front end tags wont get you far.
EDIT:
Oh, in that case get a second file server running for that folder? This should be the fastest way, use what you can from this list: list
I have a domain www.foo.com and wish to host a JAX-RS/Maven/Jersey web service there. Currently, I'm packaging the Java code into a .war file and deploying it on an Apache Tomcat 8.0 web server for testing on my local machine.
In /apache8/webapps/ROOT/index.html (localhost:8080/) I have script tags within which an XMLHttpRequest object makes a get request to localhost:8080/apiIndex/webapi/resource - which searches a resource folder in my web service directory that contains 150 or so images. The the full path names to those images are returned to my Js code, and that Js code attempts to create images out of them to be drawn to a canvas.
The problem is, I'm getting a network error saying that Js can't find/load the images.
How do I map an index.html file to my domain from within my web service directory, so that when I forward requests from my domain to port 8080 of my server I can access those images from code within my web service package? Is this the reason the Js code in the tomcat webapps folder can't load the images from my API's src/java/resources folder?
First of all: /apache8/webapps/index.html does not sound like something that's mapped to localhost:8080. I'd rather expect the / (root) webapplication to be deployed under /apache8/webapps/ROOT (and the index.html file within that folder).
I'm assuming that your web application with the images is deployed under /apache8/webapps/apiIndex. If that generates, as you say "the full path names" of your images, that can't be found: What are those full path names, and where do you expect them to be? Do you get 404 error codes or something else - like 500? Please post URLs and your expected places in the folder.
(this is posted as an answer instead of a comment because I hope that the initial description help you find the root of your problem yourself, while the second part is effectively asking for more information)
Edit: Following your comment: IMHO your webservice should rather return a http or https reference to an image, rather than a file reference. If anything else, you might need to prefix it with file:///home/... in order for the browser to consider getting it. However, if your browser shows a http document, it might not even cross that domain and embed local file resources for security reasons: Why would any webserver reference material on your local disk?
Have your images somewhere where you can reference them through http and the problem should be solved.
I was working on a Angular JS project. Basically it is a purchased theme with Angular JS, HTML, Bootstrap etc. when i tried to run it directly on browser it is broken. but when i run the same in my local server, it works fine.
I understand the importance of setting up a local server when we work on a project with server side language like PHP, .NET. what i am really confused is, why do we need to set up local server to run javascript or any javascript frame work?
Thanks in Advance.
I would like to do these examples by access "file:///C:/TempProjects/GameOfCards/index.html#/" on local computer, but most browsers cannot access these files on local computer do to Cross Origin issues. Here a StackOverflow question and answer that describes this issue: Cross origin requests(CORS) are only supported for HTTP but it’s not cross-domain. So we need a web server
There is another way, by adding a switch in your browser(chrome in this case)-
--allow-file-access-from-files
But, I suggest, running a simple server is the best way of working with things. Hope it helps. Happy Coding.
it happened for me . and I got that , when you run a js project directly , the address of some dependencies will change . for example your index is in c://www directory . if you want to open a html file which it's address in routing is in
c://www/public/... the routing would be different . because when run on a server the www directory is running and your home directory is that . but when you run directly, your home directory is where your index file is ...