HTML中的渲染问题

Rendering Issues in HTML

本文关键字:问题 HTML      更新时间:2023-09-26

我在代码中呈现撇号时遇到问题:

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';}

撇号字符呈现为&rsquo,在配置文件链接(应该是Rafal M Proxy 1's Survivor Profile,是Rafal M Proxy 1&rsquos Survivor Profile)。

显示:

Name:NineElevenRegistries.helpers.profile.getDisplayName(profile.IsProxyProfile(‌​), true, profile.Name().trim(), 'Survivor', profile.Location() ? profile.Location().Id : '', profile.Location() ? profile.Location().Name : '')

不需要’:只需写一个'字符。在javascript中,你可以像''''那样转义,或者像"'"那样用双引号括起来。