Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript HTML中的呈现问题_Javascript_Html - Fatal编程技术网

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的幸存者档案
和is
Rafal 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中,您可以像
\''
那样将其转义,或者像
''
那样将其括在双引号中,哇,那代码读起来太可怕了。