Plugins cannot find their css styles in folder - javascript

I've downloaded this template: http://themeforest.net/item/-medic-medical-health-and-hospital-html5-theme/8331329 from themeforest. Original template has /plugins/ folder in root folder. I moved this folder into /assets/plugins/ and included it in HTML like this example:
<script type="text/javascript" src="/assets/plugins/smooth-scroll.js"></script>
The javascript files are found, but plugins are still requesting their css files from original folder /plugins and not in /assets/plugins/, for example:
http://www.scsppza.local/plugins/royalslider/royalslider.css Failed to load resource: the server responded with a status of 404 (Not Found)
I can't found where is path to css files defined for those plugins. Is it possible to fix it somehow?

Open the assets/css/style.css file and change the #import urls!

Related

Where should I put these strange files in the file structure for Flask app?

So I downloaded a template for a website, with the aim to use it in my Flask app. I know the basic file structure of Flask app is this:
-app
app.py
-static
-images
-image files
-style
-css files
-templates
-html files
But when I opened the folder of the template code, I found all these strange files and I couldn't decide where to put them.
The original files:
So I put the css, fonts, images, js folders into the static folder and left the rest of the files in the templates folder along with index.html (ignore index - Copy.html, that is a copy I made of the original index.html file), updated the paths of css and js files inside the HTML document and executed app.py.
The file ran but most of the text of index.html was not loading and only one image was being displayed. I checked the logs in the command line terminal and discovered that most of the css was not even getting called.
What am I doing wrong? How should I arrange these files?
In your html file you should connect styles in this way:
<link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/style.css') }}">

JavaScript - Error 404 resource not found

I had a java script in my JSP, which worked fine. Now I want to move it to it's own file (abc.js). I created js-Folder and placed it there.
I tried to include it with <script language="JavaScript" type="text/javascript" src="./js/abc.js"></script> which links to http://localhost:8080/ProjectName/js/abc.js (from link in HTML-Code of the page). I think this should be correct, isn't it?
Nevertheless I get errors in the browser console (Failed to load resource: the server responded with a status of 404 () abc.js)
Do I have to register the .js somewhere to be recognized?
Edit: My project structure is like this:
ProjectName
|---WEB-INF
|---page.jsp (that wants to include abc.js)
|---js
|---abc.js
The WEB-INF directory is not publicly accessible. Your HTML file accesses the JS file over an public URL. Details see here: Include javascript file from inside WEB-INF
So the solution for your problem is to place the JS file on the same level as the WEB-INF directory, so that it is served publicly and adjust the src link accordingly:
<script type="text/javascript" src="${pageContext.request.contextPath}/js/abc.js"></script>
(How include an external JS file in a JSP page)

Failed to load resource: server responded with status of 404. Cannot load js files

I am trying to use jqxGrid. I am trying to link to the js files. Here is the structure of the project
Main Project
src
(below within src folder)
index.html
jqwidgets folder
Within the index.html I have links to the js as such
<script src="jqwidgets/jqxcore.js"></script>
<script src="jqwidgets/jqxdraw.js"></script>
<script src="jqwidgets/jqxbargauge.js"></script>
Here is some documentation
Angular components doc
Also a demo of what I want to achieve
demo
Any help is appreciated!

my html file won't link to stylesheets & javascript that reside in a parent directory

I am testing my website code, and I have the following folders in my working directory:
css
js
img
html (contains index.html)
When I try to bring up my website locally (the "index.html" inside of the html folder), none of the css or js files were found (404 Error).
However, before I made an html folder everything was linked together fine, and my file setup looked like this:
css
js
img
index.html
Also, when I created an "html" folder and put "index.html" inside of it, I changed the html code so that it would refer to the other files appropriately (from what I've seen on various websites):
<link href="../css/my_styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/touch_functionality.js"></script>
<img src="../img/display_photo.jpg" alt="Display Photo">
Additional Information:
I am using a local Apache server to access the "index.html" file, and I have set the DocumentRoot for the VirtualHost I made to the "/html" folder.
Additionally, I thought this may have been a permissions error, but I downloaded Cygwin and I used "chmod 711" on all of the folders in my working directory and I have used "chmod 644" on the "index.html" file inside of the html folder, but the files still wouldn't be found.
I've done my research on this for quite a few hours, but unfortunately I haven't come across a solution for this yet. Any help would be much appreciated, thank you.
Update
If I change the DocumentRoot to where all of my working space directory (instead of html) and place a .php file that simply contains the following line of code:
<?php require("html/index.html"); ?>
where my folders reside so my working directory looking like this:
-css
-js
-img
-html (contains index.html)
-index.php
Everything will work correctly. However, I would have to believe there is a way so that I don't have to do this "work-around" method. Any insight would be incredibly helpful, thanks again.
The reason being is that the web server only allows one to view files in the html directory or below.
Otherwise it will somebody to access any part of your file system.
Would you like that?
To fix this go back to the configuration that works,

why javascript library cannot be found when imported in html page deployed in Tomcat7?

I have a web service project in eclipse, and i deploy it to Tomcat by right clicking on the project and click on run on server. The following script tag is in one of the html pages:
<script type="text/javascript" src="../assests/js/lib/yui_3.6.0pr3/yui/build/yui/yui-min.js"></script>
The html page is located in folder called SamplePages which is contained in the folder TEST-WS/production, the folder assets is also in TEST-WS/production.
When i open this page in the browser, i get the following JS error:
GET http://localhost:8080/TEST-WS/production/assests/js/lib/yui_3.6.0pr3/yui/build/yui/yui-min.js 404 (Not Found)
The path TEST-WS/production/assests/js/lib/yui_3.6.0pr3/yui/build/yui/yui-min.js is correct and the .js file is there. I have other scripts like:
<script type="text/javascript" src="../assets/js/lib/all-concat.js"></script>
but it works fine. what could be the problem?
src="../assests/js
src="../assets/js
One of those paths is probably wrong.

Categories