Hi been a long time since I've been here.
I have a bit of js that adds a couple of html elements based on the value of a loop. I have a syntax error and cant spot what I've done wrong.
The error says I'm missing a closing ), but they seems to be all matched. I suspect its my quotes and double quotes, but not sure I know whats wrong with what I have now.
My js:
Code:
$(document).ready(function(){
$("##addSMRow").bind("click", function(){
if($(".sm_row").size() < 3){
$("##addSMRow").prev().append('<div class="sm_row"><div class="select socialMediaSite"><select name="socialMediaSite">#variables.artistData.socialOptionsNew#</select></div><input type="text" name="socialMediaValue" id="socialMediaValue" value="" /> <a href="##" class="remove_row">#variables.metaData.dsp["removeTxt"]#</a></div>');
}
if($(".sm_row").size() == 3){
$("##addSMRow").hide();
}
else{
$("##addSMRow").show();
}
return false;
});
if($(".sm_row").size() == 3){
$("##addSMRow").hide();
}
$(".remove_row").live("click", function(){
$(this).parent().remove();
$("##addSMRow").show();
return false;
});
});
The line the error is not liking is the fourth line I believe. Thanks for any help with his.