Website does not run properly through index.html - javascript

I have created a website with HTML, CSS and java script via Visual Studio code and as usual I have seen all changes via live server.
Through live server you can see everything properly and run everything well but if you click directly in folder on index.html then you get almost nothing. pics links and etc, not will run.
does anyone know why it is like this?
(I would like the site to be fully executable offline).
Run via VS Code Live Server
Run direct via index.html

It could be that you are linking them wrong. ../Img/Logo.png could be a wrong directory, although it is impossible to tell without showing your directory structure

Related

Open HTML with CSS in JupyterLab tab with full formatting

I create an HTML document using Sphinx. When I click on the index.html file it opens a browser and looks like this. The look depends on some .CSS and .JS files being executed:
If I open the same file from the JupyterLab file browser, it opens in a tab but looks much worse: .CSS and .JS are not displayed, and images are not displayed. It looks like this:
Is there a way to get JupyterLab to get JupyterLab to execute the .CSS and .JS and pass through any images linked in the text? The JupyterLab is running on a remote server, so I don't have the option of having it create a new browser process on my local machine, because the files are remote.
Using JupyterLab within JupyterHub (old school install with conda, no docker and such)
I've been stuck at this HTML Preview issue for a few weeks.
I have the very same use case as you (Sphinx stuff for a team to work on their docs).
So far, no luck.
It may or may not work (depending on... I'm not sure of...) if I'm using JupyterLab from the browser on the hypervisor hosting JupyterHub itself
It won't work if I'm using JupyterLab from the browser on my client machine.
I tried to mess around with
c.NotebookApp.allow_remote_access = True parameter with no luck
tried to put it in my profile ~/.jupyter/jupyter_notebook_config.py
tried to add it to general config file /path/to/conf/jupyterhub_config.py
=> Not sure of the right way to set this option on JupyterLab's JupyterHub install, nor if it's even a relevant option...
Well, security wise, it's not, that's a given (^^'), but Preview HTML is an important feature for Sphinx users, hope someone can help with this...
I also looked after nginx config, but you get the issue with or without the reverse proxy anyway...

RequireJS - Module name "wget" has not been loaded yet for context

I'm trying to run an HTML file with JavaScript inside of it. In the JavaScript I'm trying to run is a program called wget. It downloads information from a website. I used it on CMD and in a batch file to get data from an xml that is hosted locally on my computer. Now I am trying to run wget so it runs from an HTML file. (the panel.html for the twitch panel extension), however I have been having a time just making the thing run.
I have been fiddling around, and the issue I now face is when I try to run the HTML in Chrome web browser the inspector says, Module name "wget" has not been loaded yet for context.
Screenshots:
HTML:
Error from Chrome:
(Click image to enlarge)
Installed wget from cmd:
I tried to read this for hours, and I don't understand it at all. In fact I don't think the issue in the link is the same issue as mine, but this is what every search keeps coming up with. I don't understand the whole dynamic thing or why they are even using the word "dynamic" for. It just seems like they can't use require because it doesn't work against paths, however I am not trying to define a path. I just want wget to work from this HTML file. I'm annoyed that I can't find anything on this exact problem. Every problem I have seen like this doesn't have a basic example of var wget = require('wget');
I just need what's in my JavaScript or HTML script tag to work.
I downloaded the require.js file and put it into the HTML as a script tag. From here it should just work. I already downloaded wget from cmd so it's on the computer somewhere. I also put the .exe in the same folder as the .html and the require.js.
Also I read somewhere that another reason this doesn't work is because wget is "loaded" or something like that. In that case can someone tell me how to "load" wget into the HTML or JavaScript first so that this error goes away? The basic wget example I found online is:
Here is the HTML file:
I'm not using a path, I just want wget to work from JavaScript. The wget example shows that it uses require. If I don't need require then please provide an example of how I can use wget in JavaScript without require or how to make this error go away.
I've been trying to figure out the best way to get the status information from my VLC player and put it into an HTML file so I can use that as a Twitch extension on my Twitch channel. VLC media player has a status.xml when you run it as a http server. I can only access the localhost:8080/requests/status.xml from a browser because it has basic authentication where I have to put in my user name, so I use wget to put in my password and download the status.xml back to my computer as another copy that isn't setup with authenitcation. Then I can use that download status.xml's information to post what music is playing on my VLC player. The problem is I need wget to pull the information from the localhost:8080/requests/status.xml file from the html file so that whenever its ran, the status.xml gets update with the new information and this the html will post the most current thing playing on my VLC player.

IIS, PHP, JavaScript, CSS

I working on a new deployment for a Website. this websites runs since 2012.
the server getting changed to newer once.
so I installed IIS over the Server Manager Role. I Use PHP 5.2.
When I open the Site on the Server it showes me the Website but without any JS, CSS or even a button doesn't work. looks like the server doesn't includ some css files or isn't able to load JS. Only reads HTML.
In the Handlermapping I saw that .php, .html, .js or even .css is enabled.
so what im doing wrong that this website doesnt work? witch kind of information do you need to support me.
Additianal infos:
- I checked the path and its correct.
- If I change the index.php to index.html the css would be loadet but not everything.
- JS still dont work.
- I was also testing when the application is in a diffrent directory same result than wehn I change to index.hmtl.
- In the index.php file I use 3 times JS and the first line JS get called it tells me on the line xx Object expected.
dank you for hellping me

Javascript files won't load within Visual Studio ASP.NET 2.0 pro

I have just loaded an existing ASP.NET project into Visual Studio 2010 that is targeted at .NET 2.0. When I attempt to run it, the first page throws an error indicating that the JQuery file was not loaded ($ is undefined). If I paste the contents of the JQuery file within tags on the login page, everything works. This indicates to me that the JQuery file is not being loaded. I have verified that the path is correct.
This problem is not just with the JQuery file but with all JavaScript files, as far as I can tell.
I have copied this entire project directly from someone else's machine. It works perfectly on their machine. The project, on my computer, is at exactly the same path as on their machine.
If I go to IIS on my machine, and right-click on this application under Default Web Site, then choose Manage Application >> Browse, the application is displayed correctly in a browser. (I have verified that the virtual directory in IIS is pointing to my source code folder) So, it appears this issue is specific to the Visual Studio environment.
What could possibly be preventing the Javascript from loading. (the CSS files seem to be loading without error).
Thanks in advance for any debugging advice you can give me.
There can be many things wrong. Have you tried using Fiddler or FireBug and determined if the resources are requested? If they are what is the status that is being returned?
Is Visual Studio using IIS or the built-in Webserver?

Javascript not working on localhost, but it is working on Live site

I am facing JavaScript problems on XAMPP Localhost. The Collapse Buttons, go to top button and jQuery news feed are not working on every site on my localhost.
But Facebook, Twitter, Plusone buttons load correctly from remote server i.e. from the respective Social Sites.
So, I think it narrows me to the point that the JavaScript files hosted locally are not executed while those from Facebook etc. are getting executed.
I tried reinstalling XAMPP but didn't work.
I know this is old but, I had the same problem and found this question while searching a solution. But I have lampp installed on ubuntu and since Linux asks permission to execute ANYTHING, the local js files which resided in htdocs were without permission. After:
sudo chmod 777 -R /opt/lampp/htdocs
... everything was OK. Hope this helps future wanabee web developers.
It should not matter whether your files are local or not...javascript should still get executed. Try using some debugging tool like to see if you get any errors that only occur on your local machine. Because it could be that you are running some code that is depending on a domain or whatever.
I know this post is old and the answer is already given, I just wanted to give an answer of a possible reason that I encountered in case someone else finds this and it does not help.
Make sure your entire html code gets executed by viewing your page source. With me, half my code was not being executed due to a PHP error that was working on localhost with the local database but not on live with the live database. This caused the HTML to cut of from that point above my javascript.
So check your page source. If it is being cut of somewhere, find out why :)
I had the same problem. I try a lot but finally solved. The main problem was my browser cache that prevents from loading the new JavaScript file. My recommendation is that clear your browser cache data then close the browser and reopen your site again it will work perfectly.
remove any (pre in post ) blank spaces from filenames of your namespace example : localhost:port/dir /index.html
localhost:port/dir/index.html
In similar cases,
If web project site runs JS on Live Server but not on locally opened index.html,
try to check validity of HTML File Paths,
e.g you may have written:
<script src="script.js"></script>
instead of:
<script src="./script.js"></script>
Try to add ./ before file name.
./ means Current directory.

Categories

Resources