Hi,
I'm trying to write some JavaScript for a block in my email that pulls in fields from a data table (where possible). I am struggling with a syntax error somewhere and its really hard for me to debug as it is crashing Adobe Campaign quite severely. Can anyone see what's going wrong?
Solved! Go to Solution.
This below highlighted is the extra bit here:
else { %>Departing <% }%><%= formatDate(targetData.tr_date, "%2D/%2M/%4Y") %> <% } %><% }%>
Thanks,
Ishan
Views
Replies
Total Likes
This below highlighted is the extra bit here:
else { %>Departing <% }%><%= formatDate(targetData.tr_date, "%2D/%2M/%4Y") %> <% } %><% }%>
Thanks,
Ishan
Views
Replies
Total Likes
Give the following a go.
<% if (targetData.tr_nights == "any duration") { %>any duration
<% } else if (targetData.tr_nights > 0) { %><%= targetData.tr_nights %> nights
<% } else {//nothing} %>
<% if (targetData.tr_ship) { %>aboard the <%= targetData.tr_ship %>
<% } else { %>cruising<% }%>
<% if (targetData.tr_passengers) { %>for <%= targetData.tr_passengers %> passengers<% }%>.
<% if (targetData.tr_date == "any dates") { %>Departing any dates
<% } else { %>Departing <%= formatDate(targetData.tr_date, "%2D/%2M/%4Y")%><%}%>
<% if (targetData.tr_price > 0) { %>
from £<%= numberWithCommas(parseFloat(targetData.tr_price).toFixed(2)) %>.
<span style="mso-line-height: exactly; line-height:10px;"><br /><br /></span>
<% }%>
<% if (targetData.tr_reference) { %>
Reference: <font style="font-weight: bold;"><%= targetData.tr_reference %></font><br>
<% } %>
<% if (targetData.tr_code) { %>
Holiday code: <font style="font-weight: bold;"><%= targetData.tr_code %></font>
<% } %>
Views
Replies
Total Likes
Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies