Javascript HTML中的呈现问题
我在代码中呈现撇号时遇到问题:Javascript HTML中的呈现问题,javascript,html,Javascript,Html,我在代码中呈现撇号时遇到问题: if (type == 'Survivor') { display = isProxy ? (finishedRegistration ? '' : 'Unfinished ') + (name.substr(name.length - 1) == 's' ? name + '’' : name + '’s') + ' Survivor Profile' : 'My ' + (finishedRegistration ? '
if (type == 'Survivor') {
display = isProxy ? (finishedRegistration ? '' : 'Unfinished ') + (name.substr(name.length - 1) == 's' ? name + '’' : name + '’s') + ' Survivor Profile' : 'My ' + (finishedRegistration ? '' : 'Unfinished ') + (locationName ? (locationId == NineElevenRegistries.constants.lookups.survivorLocationWtc911ElsewhereId ? '9/11' : locationName) : '') + ' Survivor Profile';}
撇号字符在配置文件链接中显示为
(应为Rafal M
代理1的幸存者档案
和isRafal M代理1和rsquos幸存者档案
)
显示:
Name:NineElevenRegistries.helpers.profile.getDisplayName(profile.IsProxyProfile(), true, profile.Name().trim(), 'Survivor', profile.Location() ? profile.Location().Id : '', profile.Location() ? profile.Location().Name : '')
无需使用
代码>:只需写一个“字符”。
从javascript中,您可以像\''
那样将其转义,或者像''
那样将其括在双引号中,哇,那代码读起来太可怕了。