@Botenga delete this code you have at the end of your html:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="bootstrap.css">
</body>
and it should work now
https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js
https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1
without the jquery.min.js
part
botenga sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1381 | @sorinr |http://www.freecodecamp.org/sorinr
html-joe sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1382 | @sorinr |http://www.freecodecamp.org/sorinr
'
around it
var img = document.createElement('img')
img.src = stringified.weather[0].icon
hoxtygen sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 946 | @mot01 |http://www.freecodecamp.org/mot01
document.getElementById('image-container').innerHTML = "<img src = "+stringified.weather[0].icon+">";
hoxtygen sends brownie points to @sorinr and @mot01 :sparkles: :thumbsup: :sparkles:
:star2: 1383 | @sorinr |http://www.freecodecamp.org/sorinr
await try{this.getStreamData()}.catch(error){console.log(error)};
didn't work out when I made getStreamData async. Here's my pen:primuscovenant sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 2121 | @heroiczero |http://www.freecodecamp.org/heroiczero
catherinewoodward sends brownie points to @terensu-desu :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @terensu-desu |http://www.freecodecamp.org/terensu-desu
<html>
, <body>
sections in them - that is provided by the template.
animate.css
you can paste it into the resource boxes directly, or they have "quick adds" and a way to search for the package that you want. CodePen is a nice useful site - just remember to stick with "Pen" items for your pages, as a free user (unless you've paid) you only have one "Project". I don't think that there is a limit to the number of "Pen" items? I have seen people get confused by the fact that they can only have one "project"... maybe that will be helpful to be aware of that.
@terensu-desu Sure!
<html>
<head>
<script type="text/javascript" src="https://safi.me.uk/typewriterjs/js/typewriter.js"></script>
<script>
var app = document.getElementById('app');
var typewriter = new Typewriter(app, {
loop: true
});
typewriter.typeString('Hello World!')
.pauseFor(2500)
.deleteAll()
.typeString('Strings can be removed')
.pauseFor(2500)
.deleteChars(7)
.typeString('altered!')
.start();
</script>
</head>
<body>
<div id="app"></div>
</body>
</html>
This is my code currently. Nothing shows when I run it. Just a blank page!
indikoro sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3634 | @khaduch |http://www.freecodecamp.org/khaduch
<script>
element to the end just before the </body>
closing tag. That will insure that the page is loaded before it tries to run the JS.
$(document).wait()
hi can someone tell me how to fix this issue
i have setup a fixed navbar , the issue is the banner goes below the navbar
how to get the banner to showup after the navbar?
sorry reycuban, you can't send brownie points to yourself! :sparkles: :sparkles:
reycuban sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 482 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
its not actually, error . but when i trying to post the data and getting back the data its actually working good . but when ever i reload the page the data's i got by the server and displayed in browser is actually removed , why?additional info'
robomongo is not supported for my system
so i cant able to seet the data stored or not!
my system is 32bit os!
its not actually, error . but when i trying to post the data and getting back the data its actually working good . but when ever i reload the page the data's i got by the server and displayed in browser is actually removed , why?additional info'
robomongo is not supported for my system
so i cant able to seet the data stored or not!
my system is 32bit os!this is the problem
.
const express = require('express');
const router = express.Router();
const cricketModel = require('../model/score');
router.get('/api/maxi',function(req,res){
res.send({"type" : "get"});
});
router.post('/api/maxi/',function(req,res){
cricketModel.create(req.body).then(function(data){
res.send(data);
console.log(data);
}).catch(err => console.error(err) && res.status(400).send(err));
});
router.delete('/api/maxi/:id',function(req,res){
res.send({"type" : "delete"});
});
router.put('/api/maxi/:id',function(req,res){
res.send({"type" : "update"});
});
module.exports = router;
const express = require('express');
const router = require('./api/router.js');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const app = express();
mongoose.connect("mongodb://localhost/gomaxi");
mongoose.Promise = global.Promise;
app.use(express.static('public'));
app.use(bodyParser.json());
app.use(router);
app.listen(4000,function(){
console.log("server is listening for the request on port 4000 , hurray !");
});
its not actually, error . but when i trying to post the data and getting back the data its actually working good . but when ever i reload the page the data's i got by the server and displayed in browser is actually removed , why?
note :
robomongo is not supported for my system
so i cant able to seet the data stored or not!
my system is 32bit os!
data
back
router.get('/api/maxi',function(req,res){
console.log('1');
res.send({"type" : "get"});
});
router.post('/api/maxi/',function(req,res){
console.log('2')
cricketModel.create(req.body).then(function(data){
res.send(data);
console.log(data);
}).catch(err => console.error(err) && res.status(400).send(err));
});
router.delete('/api/maxi/:id',function(req,res){
res.send({"type" : "delete"});
});
router.put('/api/maxi/:id',function(req,res){
res.send({"type" : "update"});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>maxi</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<input id="search1" placeholder="enter playername">
<input id="search2" placeholder="enter playerscore">
<button class="btn-primary">click</button>
<div class="well"></div>
</body>
<script>
$(document).ready(function(){
$(".btn-primary").click(function(){
console.log("click");
var obj = {
"player" : $("#search1").val(),
"score" : $("#search2").val()
};
$.ajax({
type : "POST",
url : "http://localhost:4000/api/maxi/",
contentType : "application/json",
data : JSON.stringify(obj),
success : function(data){
console.log(data);
$(".well").append("<h1>"+data.player + data.score+"</h1>");
},
error : function(err){
console.log('error' ,err);
},
dataType : "json"
});
});
});
</script>
</html>
```router.post('/', function (req, res, next) {
var user = new User({
firstName: req.body.firstName,
lastName: req.body.lastName,
password: bcrypt.hashSync(req.body.password, 10),
email: req.body.email
});
user.save(function(err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
});```
const express = require('express');
const router = express.Router();
const cricketModel = require('../model/score');
router.get('/api/maxi',function(req,res){
res.send({"type" : "get"});
});
router.post('/api/maxi/',function(req,res){
console.log("2");
cricketModel(req.body).save().then(function(data){
res.send(data);
console.log(data);
}).catch(err => console.error(err) && res.status(400).send(err));
});
router.delete('/api/maxi/:id',function(req,res){
res.send({"type" : "delete"});
});
router.put('/api/maxi/:id',function(req,res){
res.send({"type" : "update"});
});
module.exports = router;
@1532j0004kg how about ```router.post('/api/maxi/', function (req, res, next) {
console.log('2');
console.log(body);
cricketModel.save(function (err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
```
```router.post('/api/maxi/', function (req, res, next) {
console.log('2');
console.log(body);
cricketModel.save(function (err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
```
```router.post('/api/maxi/', function (req, res, next) {
console.log('2');
console.log(body);
cricketModel.save(function (err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
```
router.post('/api/maxi/', function (req, res, next) {
console.log('2');
console.log(body);
cricketModel.save(function (err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
Mongoose: scores.insert({ player: 'q1', score: 1, _id: ObjectId("5a47bd6590f3561
5fc1c5ffe"), __v: 0 })
{ __v: 0, player: 'q1', score: 1, _id: 5a47bd6590f35615fc1c5ffe }
2
Mongoose: scores.insert({ player: 'q1w2', score: 1, _id: ObjectId("5a47bd6c90f35
615fc1c5fff"), __v: 0 })
{ __v: 0,
player: 'q1w2',
score: 1,
_id: 5a47bd6c90f35615fc1c5fff }
2
Mongoose: scores.insert({ player: 'q1w2as', score: 1, _id: ObjectId("5a47bd7390f
35615fc1c6000"), __v: 0 })
{ __v: 0,
player: 'q1w2as',
score: 1,
_id: 5a47bd7390f35615fc1c6000 }
```router.post('/api/maxi/', function (req, res, next) {
console.log('2');
console.log(body);
var cricketModel = new CricketModel({
firstField: req.body.firstField, // Your model fields here
lastField: req.body.lastField,
});
cricketModel.save(function (err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
});```
```router.post('/api/maxi/', function (req, res, next) {
console.log('2');
console.log(body);
var cricketModel = new CricketModel({
firstField: req.body.firstField, // Your model fields here
lastField: req.body.lastField,
});
cricketModel.save(function (err, result) {
if (err) {
// If there is an error, return from this function immediately with
// the error code
return res.status(500).json({
title: 'An error occurred',
error: err
});
}
res.status(201).json({
message: 'Saved User',
obj: result
});
});
});```
Mongoose: scores.insert({ player: 'q1', score: 1, _id: ObjectId("5a47bd6590f3561
5fc1c5ffe"), __v: 0 })
{ __v: 0, player: 'q1', score: 1, _id: 5a47bd6590f35615fc1c5ffe }
2
Mongoose: scores.insert({ player: 'q1w2', score: 1, _id: ObjectId("5a47bd6c90f35
615fc1c5fff"), __v: 0 })
{ __v: 0,
player: 'q1w2',
score: 1,
_id: 5a47bd6c90f35615fc1c5fff }
2
Mongoose: scores.insert({ player: 'q1w2as', score: 1, _id: ObjectId("5a47bd7390f
35615fc1c6000"), __v: 0 })
{ __v: 0,
player: 'q1w2as',
score: 1,
_id: 5a47bd7390f35615fc1c6000 }
C:\Users\dinesh\Desktop\app1>scores.find();
'scores.find' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\dinesh\Desktop\app1>mongo.exe
'mongo.exe' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\dinesh\Desktop\app1>start mongo.exe
The system cannot find the file mongo.exe.
C:\database_mongo\mongodb-win32-i386-3.2.18-4-g752daa3\bin>
> scores.find();
2017-12-30T08:49:19.995-0800 E QUERY [thread1] ReferenceError: scores is not
defined :
@(shell):1:1
C:\database_mongo\mongodb-win32-i386-3.2.18-4-g752daa3\bin>mongo
2017-12-30T08:50:02.775-0800 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
MongoDB shell version: 3.2.18-4-g752daa3
connecting to: test
Server has startup warnings:
2017-12-30T06:55:07.242-0800 I CONTROL [initandlisten]
2017-12-30T06:55:07.242-0800 I CONTROL [initandlisten] ** WARNING: This 32-bit
MongoDB binary is deprecated
2017-12-30T06:55:07.243-0800 I CONTROL [initandlisten]
2017-12-30T06:55:07.244-0800 I CONTROL [initandlisten]
2017-12-30T06:55:07.245-0800 I CONTROL [initandlisten] ** NOTE: This is a 32 bi
t MongoDB binary.
2017-12-30T06:55:07.270-0800 I CONTROL [initandlisten] ** 32 bit builds a
re limited to less than 2GB of data (or less with --journal).
2017-12-30T06:55:07.271-0800 I CONTROL [initandlisten] ** Note that journ
aling defaults to off for 32 bit and is currently off.
2017-12-30T06:55:07.272-0800 I CONTROL [initandlisten] ** See http://doch
ub.mongodb.org/core/32bit
2017-12-30T06:55:07.274-0800 I CONTROL [initandlisten]
>
> use database
switched to db database
> scores.find()
2017-12-30T08:52:26.512-0800 E QUERY [thread1] ReferenceError: scores is not
defined :
@(shell):1:1
> collections.find()
2017-12-30T08:52:36.159-0800 E QUERY [thread1] ReferenceError: collections is
not defined :
@(shell):1:1
> show collections
>
C:\database_mongo\mongodb-win32-i386-3.2.18-4-g752daa3\bin>mongo
2017-12-30T08:50:02.775-0800 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
MongoDB shell version: 3.2.18-4-g752daa3
connecting to: test
Server has startup warnings:
2017-12-30T06:55:07.242-0800 I CONTROL [initandlisten]
2017-12-30T06:55:07.242-0800 I CONTROL [initandlisten] ** WARNING: This 32-bit
MongoDB binary is deprecated
2017-12-30T06:55:07.243-0800 I CONTROL [initandlisten]
2017-12-30T06:55:07.244-0800 I CONTROL [initandlisten]
2017-12-30T06:55:07.245-0800 I CONTROL [initandlisten] ** NOTE: This is a 32 bi
t MongoDB binary.
2017-12-30T06:55:07.270-0800 I CONTROL [initandlisten] ** 32 bit builds a
re limited to less than 2GB of data (or less with --journal).
2017-12-30T06:55:07.271-0800 I CONTROL [initandlisten] ** Note that journ
aling defaults to off for 32 bit and is currently off.
2017-12-30T06:55:07.272-0800 I CONTROL [initandlisten] ** See http://doch
ub.mongodb.org/core/32bit
2017-12-30T06:55:07.274-0800 I CONTROL [initandlisten]
>
C:\mongodbs
C:\database_mongo\mongodb-win32-i386-3.2.18-4-g752daa3\bin>mongod --dbpath C:\mongodbs
C:\database_mongo\mongodb-win32-i386-3.2.18-4-g752daa3\bin>mongo
C:\database_mongo\mongodb-win32-i386-3.2.18-4-g752daa3\bin>mongod --dbpath C:\mo
ngodbs
2017-12-30T08:59:19.588-0800 I CONTROL [main]
2017-12-30T08:59:19.592-0800 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2017-12-30T08:59:19.593-0800 I CONTROL [main]
2017-12-30T08:59:19.602-0800 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
2017-12-30T08:59:19.611-0800 I CONTROL [initandlisten] MongoDB starting : pid=3
544 port=27017 dbpath=C:\mongodbs 32-bit host=dinesh007
2017-12-30T08:59:19.614-0800 I CONTROL [initandlisten] targetMinOS: Windows Vis
ta/Windows Server 2008
2017-12-30T08:59:19.615-0800 I CONTROL [initandlisten] db version v3.2.18-4-g75
2daa3
2017-12-30T08:59:19.617-0800 I CONTROL [initandlisten] git version: 752daa30609
5fb1610bb5db13b7b106ac87ec6cb
2017-12-30T08:59:19.618-0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-12-30T08:59:19.619-0800 I CONTROL [initandlisten] modules: none
2017-12-30T08:59:19.622-0800 I CONTROL [initandlisten] build environment:
2017-12-30T08:59:19.623-0800 I CONTROL [initandlisten] distarch: i386
2017-12-30T08:59:19.624-0800 I CONTROL [initandlisten] target_arch: i386
2017-12-30T08:59:19.625-0800 I CONTROL [initandlisten] options: { storage: { db
Path: "C:\mongodbs" } }
2017-12-30T08:59:19.632-0800 E NETWORK [initandlisten] listen(): bind() failed
errno:10048 Only one usage of each socket address (protocol/network address/port
) is normally permitted. for socket: 0.0.0.0:27017
2017-12-30T08:59:19.633-0800 E STORAGE [initandlisten] Failed to set up sockets
during startup.
2017-12-30T08:59:19.635-0800 I CONTROL [initandlisten] dbexit: rc: 48
omgmerrickd sends brownie points to @vasejs and @import :sparkles: :thumbsup: :sparkles:
:cookie: 394 | @vasejs |http://www.freecodecamp.org/vasejs
function palindrome(str) {
var x = str.split('').reverse().join('');var y = x.replace(/[\W_]/g, '');
var palindr = y.toLowerCase();if ( palindr == str){
return true;}
else {return false;
}
}
palindrome("eye");
like this
sorry vasejs, you can't send brownie points to yourself! :sparkles: :sparkles:
``` function palindrome(str) {
var x = str.split('').reverse().join('');
var y = x.replace(/[\W_]/g, '');
var palindr = y.toLowerCase();
if ( palindr == str){
return true;
}
else {
return false;
}
}
palindrome("eye"); ```
sakisbal sends brownie points to @vasejs :sparkles: :thumbsup: :sparkles:
:cookie: 396 | @vasejs |http://www.freecodecamp.org/vasejs
function palindrome(str) {
var x = str.split('').reverse().join('');
var y = x.replace(/[\W_]/g, '');
var palindr = y.toLowerCase();
if ( palindr == str){
return true;
}
else {
return false;
}
}
palindrome("eye");
return str.replace(/[\W_]/g, '').toLowerCase()===
str.replace(/[\W_]/g, '').toLowerCase().split('').reverse().join('');