Bonsai Project


#1

Hi,

I'm fairly sure my code is correct but i'm getting an error in the console, saying i'm missing a closing ) on line 3.
However everything is closed. Would appreciate some help, my code is -

var main = function() {
$('#top-text').keyup(function(){
var toAdd = $('#top-text').val();
$('.top-caption').text();
}):
$('#bottom-text').keyup(function(){
var toAdd = $('#bottom-text').val(){
$('.bottom-caption').text();
});
};

$(document).ready(main);

Many thanks


#2

Hi Andrew,

On line 5, you need a semi-colon (;) instead of a colon (:) :)


#3

Thanks for the reply, I found the colon and fixed that earlier but it's still not working :frowning:


#4

OK, I see your other problem :)
Between the parenthesis (()) of text(), you need to add toAdd, like this:

/* ... */.text(toAdd);

#5

Brill, thanks it's working now!


#6

Hi Andy, I was just looking through your post and noticed you didn't add any code for the keyup event handler to update the meme's image. Just thought i would point that out for yourself and future readers. Happy coding!


#7

@cmm21 The code looks fine to me, after applying the fixes I've suggested. Could you point out where the problem you're seeing in the code is?


#8

@zystvan The code is fine, but the instructions also ask for the user to add code to change the background image.

[Edit by moderator: removed code]


#9

@cmm21 Thanks for clarifying. I just assumed that Andrew was on an earlier step, I guess :)

I've had to edit your post to remove the code since it's against the forum guidelines to post stuff like that, but thanks for posting it anyway.