ajaxSetup
use is not recommended.)
$(document).ready(function() {
$.ajaxSetup({
cache: false
});
$("#quoteButton").on("click", function() {
$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
$("#quoteBox").html(a[0].content + "<p>— " + a[0].title + "</p>")
});
});
});
:warning: achudoz already gave khaduch points
function getCurrentWeather() {
$.ajax({
url: 'http://samples.openweathermap.org/data/2.5/weather/' ,
jsonp: 'jsonp',
data: {
id: '2172797',
appid: 'b1b15e88fa797225412429c1c50c122a1'
},
type: "GET",
dataType: "jsonp"
})
$done(function(json) {
$('#show-weather').text(json.coord.lon);
})
}
});
@reeversedev - I don't think that you put $done
for that? I think that you include it within the object parameters for the ajax call? Maybe like this:
$(document).ready(function(){
function getCurrentWeather() {
$.ajax({
url: 'http://samples.openweathermap.org/data/2.5/weather/' ,
jsonp: 'jsonp',
data: {
id: '2172797',
appid: 'b1b15e88fa797225412429c1c50c122a1'
},
type: "GET",
dataType: "jsonp".
done: function(json) {
$('#show-weather').text(json.coord.lon);
})
}
});
Although what you did might be an alternate way to do that? Want to post your URL?
:cookie: 277 | @achudoz |http://www.freecodecamp.com/achudoz
@janepohorecka I just tried it and it works. I added
<fieldset style="margin: -20px;">
Of course the better solution is to do it in css but the code is pretty messy and I am too lazy to look deep into it. just try working with negative margins and preferably define a single css class that you will use for each one of your input fields