Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.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 如果图像不可用,则显示文本_Javascript_Jquery_If Statement - Fatal编程技术网

Javascript 如果图像不可用,则显示文本

Javascript 如果图像不可用,则显示文本,javascript,jquery,if-statement,Javascript,Jquery,If Statement,我正在编写一个自定义SharePoint项_XX.html模板,该模板正在从我的SharePoint自定义列表中输入数据。不过,我不知道如何“分解”脚本。在输出显示html时,如何使用if-else语句 你会发现我想说: 如果存在LogoSrc数据,请将数据添加到映像src。否则显示文本(标题字段中的dtaa) 如果(!LogoSrc==null){ }否则{ #=Title=#_ } SharePoint Item_XX.html文件需要特定的脚本语法。解决办法是: <!--#_ if

我正在编写一个自定义SharePoint项_XX.html模板,该模板正在从我的SharePoint自定义列表中输入数据。不过,我不知道如何“分解”脚本。在输出显示html时,如何使用if-else语句

你会发现我想说: 如果存在LogoSrc数据,请将数据添加到映像src。否则显示文本(标题字段中的dtaa)

如果(!LogoSrc==null){
}否则{

#=Title=#_

}
SharePoint Item_XX.html文件需要特定的脚本语法。解决办法是:

<!--#_ if(LogoSrc){ _#-->
    <img src="_#= $htmlEncode(LogoSrc) =#_" />
<!--#_ } _#--> 
<!--#_ if(LogoSrc.isEmpty){ _#-->
    <p style="font-size: 13pt; font-family: 'Malgun Gothic', Arial, sans-serif; color: #000000; font-weight: 700; text-transform: uppercase;">_#= Title =#_</p>
<!--#_ } _#--> 

#=标题=#_


else条件将进入的div元素是什么??
<!--#_ if(LogoSrc){ _#-->
    <img src="_#= $htmlEncode(LogoSrc) =#_" />
<!--#_ } _#--> 
<!--#_ if(LogoSrc.isEmpty){ _#-->
    <p style="font-size: 13pt; font-family: 'Malgun Gothic', Arial, sans-serif; color: #000000; font-weight: 700; text-transform: uppercase;">_#= Title =#_</p>
<!--#_ } _#-->