I have a index.html that is served by a node.js server, unfortunately I am having trouble loading bootstrap when I use my local downloaded bootstrap library; when I use bootstrap served from the web it works fine.
Website works when bootstrap included like this
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
Website doesn't work when bootstrap included like this
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link type="text/json" href="node_modules/bootstrap/dist/css/bootstrap.min.css.map">
<script type="text/javascript" src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link type="text/json" href="node_modules/bootstrap/dist/js/bootstrap.min.js.map">
When I look at the node server logs, I see that the source map is failing to be served to the client.
/node_modules/bootstrap/dist/js/bootstrap.min.js.map
_http_outgoing.js:464
throw err;
^
TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "Content-type"
at ServerResponse.setHeader (_http_outgoing.js:473:3)
at C:\Users\Dwight\work\trainingwebsite/Server.js:109:20
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
I've tried using bootstrap 4.0.0 and 4.4.1 but both exhibit the same behaviour.
Why is this happening only when I use my local bootstrap? I've tried setting different types for the source map include but I keep getting the same error...
Update:
When I disable source maps on google chrome settings, the site loads fine with local bootstrap.
Try changing it to:
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css.map">
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script href="node_modules/bootstrap/dist/js/bootstrap.min.js.map">
Related
The website does not display anything. It gives the error: firebaseui not defined.
I am running my code in eclipse, on my localhost web server. The error is displayed in "app.js" file of a sample web application I took from github. The output must show sign-in widgets.
var ui = new firebaseui.auth.AuthUI(firebase.auth());
Add this into the HTML page's <head>, because firebaseui.js defines the missing firebaseui:
<script src="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/3.5.2/firebaseui.css" />
This must be loaded before the app.js is being loaded, so the it won't be undefined anymore.
<!-- own css location -->
<link rel="stylesheet" href="/css/login.css">
<!-- own javascript location -->
<script type="text/javascript" src="/js/login.js"></script>
this is how the i have given the link for my js and css.
it is working fine in spring boot internal server but if i convert to war and when i deployed it in apache tomcat 9.0 server it is returning 404 error, for the above mentioned resources.
You can set a <base> tag in index.html or specify full path with server name and port.
I'm using ckeditor in my website.
I have ckeditor folder with ckeditor.js file in same directory as my index.html
I need to host my sites with xampp because my php files.
Index.html
<html>
<head>
<title>Responsive</title>
<link rel="stylesheet" type="text/css" href="main.css">
<script src="ckeditor/ckeditor.js"></script>
</head>
<body>
<textarea rows="5" cols="50" id="editor"></textarea>
<script>
CKEDITOR.replace("editor");
</script>
</body>
</html>
In google chrome
<textarea id="editor"></textarea> is hidden when i go http://localhost/index.html and visible when i go file:///C:/xampp/htdocs/index.html
I got ckeditor.js:835 Uncaught TypeError: Cannot read property 'button' of undefined error in console
How do I fix this?
I've generated a project with john papas hottowel.
gulp serve-build
is working.
When I drop the build folder to my apache server the app is not working. It's not finding the files, although they are there.
localhost/:15 GET http://localhost/styles/lib-7947d5e2c5.css
localhost/:17 GET http://localhost/styles/app-ba4747fbb6.css
localhost/:34 GET http://localhost/js/lib-e827a87368.js
localhost/:36 GET http://localhost/js/app-9e5293691e.js 404 (Not Found)
The index.html is found.
<head>
...
<link rel="stylesheet" href="styles/lib-7947d5e2c5.css">
<link rel="stylesheet" href="styles/app-ba4747fbb6.css">
</head>
<body>
...
<script src="js/lib-e827a87368.js"></script>
<script src="js/app-9e5293691e.js"></script>
</body>
What can be wrong?
You will need to turn off HTML5 Mode and change base URL.
Turn off HTML5 mode in app/blocks/router-helper.provider.js.
Line 18: $locationProvider.html5Mode(false);
Comment out base in index.html
Line 17: <base href="/">
By doing this your web app will route to a 404 by default. To fix this you can change the core route to / instead of /404 within app/core/core.route.js
By doing this you will get a #/ within your URL.
I am using google drive to host the following website:
https://e8edf64c16f714a3eb501e781f477ae636ff655a.googledrive.com/host/0B-CU-bHZqNGdeWd1RTlZd0xGUFU
I have the following code in my index.html file:
<!-- These are my resources -->
<link rel="stylesheet" href="resources/jquery-ui-1.10.4.custom/css/ui-lightness/jquery-ui-1.10.4.custom.css"/>
<script src="resources/jquery-2.0.2.js"></script>
<script src="resources/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script>
<script src="resources/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.draggable.js"></script>
But i am getting this console error
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
I am not sure what is going on here, this use to work just fine.