Thread: syntax error
View Single Post
Old 09-19-2012, 04:19 PM   PM User | #1
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
syntax error

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.
__________________
Teed
teedoff is offline   Reply With Quote