![]() |
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(){ |
Glad to see another CF developer on the site!
What does the IE or FF error console say? |
Sorry forgot to include that. Yep CF here! Not many of us around..lol
Thanks for the assistance. Timestamp: 9/19/2012 11:41:13 AM Error: SyntaxError: unterminated string literal Source File: https://dev.getconquer.com/index.cfm...dingArtistInfo Line: 672, Column: 41 Source Code: $("#addSMRow").prev().append().html("<div class='sm_row'><div class='select socialMediaSite'><select name='socialMediaSite'> |
it seems like you may want to try this:
Code:
$("##addSMRow").prev().append('<div class="sm_row"><div class="select socialMediaSite"><select name="socialMediaSite"><cfoutput>#variables.artistData.socialOptionsNew#</cfoutput></select></div><input type="text" name="socialMediaValue" id="socialMediaValue" value="" /> <a href="##" class="remove_row"><cfoutput>#variables.metaData.dsp["removeTxt"]#</cfoutput></a></div>'); |
Quote:
|
Crap how stupid am I?? lol its breaking on the hash marks. Escaping them seems to have eliminated my code! Not sure the js works correctly or not, but thanks all!
|
Ok well the original issue is fixed, however now I have a new issue. When I click the text to add a row, it does indeed add a row. Upon adding a row, it should display a text link for removing a row. Instead this displays the literal value of the variable.....
So instead of displaying a text link "Remove Row", it displays: #variables.metaData.dsp["removeTxt"]# |
That just means that the code isn't wrapped with <cfoutput></cfoutput>.
Or am I missing something? |
Quote:
Thanks for the help. It is now fixed and reworked so I dont have all that crap html inside an append function. If interested, here's the js: Code:
$(document).ready(function(){ |
| All times are GMT +1. The time now is 02:28 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.