click()
method in jQuery to my code. You can find my pen here: http://codepen.io/twhite96/pen/9b61fc44a276edb9bbb405cac84cf938?editors=1111
javascript
$(“#button-id”).click(function() {
// do somethting here
};
$("#generate").on("click", getQuote);
which calls the getQuote()
function when the button is clicked
ryanwfile sends brownie points to @rom2711 :sparkles: :thumbsup: :sparkles:
:cookie: 361 | @rom2711 |http://www.freecodecamp.com/rom2711
ryanwfile sends brownie points to @rom2711 :sparkles: :thumbsup: :sparkles:
:warning: ryanwfile already gave rom2711 points
body {
background-color:grey;
}
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding-top: 20px;
padding-bottom: 20px;
text-decoration: none;
}
li a:hover {
background-color: #555;
color: white;
}
.active {
background-color: #4CAF50;
color: white;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 25%;
background-color: #f1f1f1;
height: 100%;
position: fixed;
overflow: auto; /Enable scrolling if there is too much content./
}
li {
text-align: center;
border-bottom: 1px solid #555;
}
My HTML is:
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">NEWS</a></li>
<li><a href="#">CONTACT</a></li>
<li><a href="#">ABOUT</a></li>
</ul>
konikodes sends brownie points to @aaronbakerut :sparkles: :thumbsup: :sparkles:
:cookie: 121 | @aaronbakerut |http://www.freecodecamp.com/aaronbakerut
lpy1994 sends brownie points to @aaronbakerut :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @aaronbakerut |http://www.freecodecamp.com/aaronbakerut
aaronbakerut sends brownie points to @lpy1994 :sparkles: :thumbsup: :sparkles:
:cookie: 210 | @lpy1994 |http://www.freecodecamp.com/lpy1994
on my twitch project. I am having trouble with my JSON call.
http://codepen.io/MikeBeers/pen/PzmpgV?editors=0002
I am displaying my call back to the console. I have one account that should come back with an error but it will not display. If I add "callback=?" to JSON call the account with the error will now show in the console. But then the images for my logos will not display and the status of the account will not display. What is going on with the "callback=?"
Line 13 in my codepen.
mikebeers sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1241 | @dhcodes |http://www.freecodecamp.com/dhcodes
how to remove the white border at the bottom of my navbar?
+
. One moment.
p
tags itself. Trying to find a way to trim that.
twhite96 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 1498 | @manish-giri |http://www.freecodecamp.com/manish-giri
success: function(data) {
var post = data.shift(); // The data is an array of posts. Grab the first one.
var quoteContent = $(post.content);
console.log(quoteContent);
$('p').html(post.content);
$('#tweet-quote').click(function(e) {
//We tell our browser not to follow that link
e.preventDefault();
//We get the URL of the link
window.open('https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + quoteContent.text());
});
window.open('https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + $(post.content).text());
var temp = post.content;
temp = temp.replace(/<p>/g, "");
twhite96 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 528 | @sorinr |http://www.freecodecamp.com/sorinr
overflow: hidden;
i did that, and it works but than overflow has no meaning, i.e, putting overflow hidden inside the container also shows the container scrollable, which i don't want.
I want to have a scrollbar inside container div not on body
.wrapper{
margin: 0px 10px;
}
.container {
max-height: 100%;
height: 100vh;
display: flex;
flex-direction: column;
overflow-y: auto;
}
shub1427 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1292 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
$(document).on('keydown.autocomplete', selector, function() {
$(this).autocomplete({
source: function(request, response) {
$.ajax({
url: "http://en.wikipedia.org/w/api.php",
dataType: "jsonp",
data: {
'action': "opensearch",
'format': "json",
'search': request.term
},
success: function(data) {
response(data[1]);
}
});
}
});
});
hbnker31 sends brownie points to @harry97 and @brainyfarm :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for harry97
:cookie: 65 | @brainyfarm |http://www.freecodecamp.com/brainyfarm
harry97 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 529 | @sorinr |http://www.freecodecamp.com/sorinr
@font-face {
font-family: 'camera-icons-local';
src: url("https://tympanus.net/Development/ImageGridEffects/fonts/camera-icons/camera-icons.ttf");
font-weight: normal;
font-style: normal;
}
target"_blank"
as an attribute in your a
element instead of target="_blank"
#names, #forecast-icons{
display: flex;
flex-direction: row;
justify-content: center;
}
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 530 | @sorinr |http://www.freecodecamp.com/sorinr
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Getting Started with Bootstrap</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-limanAbba-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">LimanAbba</a>
</div>
<div class="collapse navbar-collapse" id="bs-limanAbba-navbar-collapse-1">
<div class="navbar-header navbar-right">
<ul class="nav navbar-nav">
<li><a href="#">Freelance</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>\
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span><ul class="dropdown-menu">
<li><a href="#">Liman</a></li>
<li><a href="#">Code90</a></li>
<li><a href="#">Coding</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<div class="container">
</div></div></div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
A friend of mine gave me this task. To extract the website from this.
77923B4D0R3B&url=httpwww.oldscpa.com
8009285G5S821H&url=httpwww.yachats.org
11224640Q0N6C34&url=httpwww.funstasticshows.com
Guide me how to do this? I want the part like `www.oldscpa.com' from each line. Should I use regex or what?
/w{3}\..+/
"77923B4D0R3B&url=httpwww.oldscpa.com".match(/.*http(.*)/)[1]
"www.oldscpa.com"
faisal1337 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2115 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
var str = "11480668G3O923B&url=httpwww.feynmangroup.com103946E3L9H729C&url=httpwwvchamber.com74940N0F257N&url=httpwww.oregonsports.org10590634N4P2B4P&url=httpwww.kaiserpermanente.org%2f77923B4D0R3B&url=httpwww.oldscpa.com8009285G5S821H&url=httpwww.yachats.org11224640Q0N6C34&url=httpwww.funstasticshows.com";
var arr = [];
arr = str.split("=http");
arr[1] = arr[1].split("0-9+");
console.log(arr[1]);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<input type="file" id="input">
</body>
</html>
var lines = $('#input')[0].files[0].val().split('\n');
console.log(lines);
Uncaught reference error $ is not defined
pen.js:8 Uncaught TypeError: Cannot read property 'val' of undefined
faisal1337 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 532 | @sorinr |http://www.freecodecamp.com/sorinr
mohammadhasham sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 533 | @sorinr |http://www.freecodecamp.com/sorinr
display: none
<a href="#idoftarget">
with id of your target
here it is,
<a href="" class="btn navbar-btn btn-default abelFont">About</a>
yes sir :)
mremotoo sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 321 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
<img src="urltoyourimage" alt="" >
<a href=""><img ... ></a>
adblock31 sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 322 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
@lleander i used var api="https://crossorigin.me/https://en.wikipedia.org/w/api.php?action=query&titles="+$input+"&prop=revisions&rvprop=content&format=json";
where $input is a variable that holds $(input[type"search"]).val(). that way the api has to search on whatever it is given. though. i am having trouble with my own wiki so take it as you will
rao-sumeet sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 323 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
lleander sends brownie points to @mpettaw2 and @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 271 | @mpettaw2 |http://www.freecodecamp.com/mpettaw2
:cookie: 324 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
$("body").append("<div class='well'>"+data[1][i] + "</div><div class='well'>"+ data[2][i] + "</div><div class='well'>" +data[3][i] + "</div>");
```$("#parag").append("<pclass='well'>"+data[1][i] + "</p><pclass='well'>"+ data[2][i] + "</p><p class='well'>" +data[3][i] + "</p>");
i found this stuff on
mohammadhasham sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 325 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
lleander sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 687 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
$("#parag").append("<p class='well'><a href="+dataOfLink+">"+ your text
lleander sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: lleander already gave tylermoeller points
mohammadhasham sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:warning: mohammadhasham already gave alexanderdom points
jacobstewart1 sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 326 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
$(".myButton").click(function() {
clickedQuote();
});
$(".myButton").click(clickedQuote);
jacobstewart1 sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:warning: jacobstewart1 already gave alexanderdom points
@AlexanderDom
Ajax code
$.ajax({
url:"http://my-homepage-link/json.json?jsoncallback=?",
type:"GET",
dataType:"jsonp",
beforeSend:function(){
console.log("before send");
},
success:function(data,status){
console.log("success");
}
});
My json file in my homepage
{
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 25,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
},
"phoneNumbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
},
{
"type": "mobile",
"number": "123 456-7890"
}
],
"children": [],
"spouse": null
}
url:"http://my-homepage-link/json.json?callback=''"
paragonchuy sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 327 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
transition:opacity 0.3s ease-in;
;)
bomholt sends brownie points to @alexanderdom :sparkles: :thumbsup: :sparkles:
:cookie: 328 | @alexanderdom |http://www.freecodecamp.com/alexanderdom
$(document).ready(function() {
$("#input1").keypress(function(event) {
console.log(event);
if (event.keyCode == 13) {
$(".title").removeClass("title");
$(".random").removeClass("random");
$.getJSON("https://www.crossorigin.me/https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=" + $("#input1").val(), function(json) {
var html = "";
json.query.search.forEach(function(val) {
$.getJSON("https://www.crossorigin.me/https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&&exsentences=1&titles=" + val.title, function(json) {
html += '<div style="text-align:left;" class="entry"><a href="https://en.wikipedia.org/?curid=' + Object.values(json.query.pages)[0].pageid + '" target="_blank">' + '<h4>' + Object.values(json.query.pages)[0].title + "</h4>" + Object.values(json.query.pages)[0].extract + "</a></div><br>";
$(".result1").html(html);
});
});
});
};
});
});
+ Object.values(json.query.pages)[0].pageid // there is no Object.value