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?
Related
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">
I use inspect to check and it shows as below:
lottie.js:3 Failed to load file:///Users/Downloads/ani/js/data.json: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
I dont know how to read Json from a .json file from my local sever?
can anyone help me to solve it?
var animation = bodymovin.loadAnimation({
container: document.getElementById('Ani'),
renderer: 'svg',
loop: true,
autoplay: true,
path: 'js/data.json'
})
<!DOCTYPE html>
<html>
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bodymovin Demo</title>
<!-- Styles -->
<style>
#Ani{max-width: 800px; margin:0 auto;}
</style>
</head>
<body>
<div id="Ani"> </div>
<!-- Scripts -->
<script src="js/lottie.js"></script>
<script src="js/script.js"></script>
</body>
</html>
You are opening the file with the file protocol and you try an Ajax request. That wont work. You better open the file over a server. You can use apache or any webserver? By example if you are familiar with Node you can use http-server
or use lite-server.
npm install http-server -g
http-server 'path/to/your/project' -o
That should open the browser window at: localhost:8080 or other port if 8080 is not free
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 new to javascript, need help.
I have created a index.html and a app.js (both in same path), and have hosted the index.html as localhost.
When I run individual index.html I do get the hello alert, but when I run using localhost I get "Uncaught SyntaxError: Unexpected token <" error.
Below is the code that i used:
Index.html:
<!DOCTYPE HTML>
<html>
<head>
<title>Show Javascript alert</title>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
</body>
</html>
app.js:
function display_alert(){
alert("Hello!");
}
window.onload = display_alert;
I think the Webserver is not serving your app.js File. Have you tried to open it in your Browser, to check if the Path is right?(e.g. http://localhost/app.js).
Check if the Name of the File is Lowercase as well and if the Webserver has read Permissions on the File.
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.