繁体   English   中英

如何使用mysql的javascript提取格式显示数据?

[英]how to display data in format using javascript extract from mysql?

这是我从数据库中提取数据以及“异常”出现时要在视图中呈现数据的原因,我想在新行中显示。 但是我想以适当的方式在单行中显示它们

The requirements of this chapter apply to the following: (1) New buildings or portions thereof used as health care occupancies (see 1.4.1) (2) Additions made to, or used as, a health care occupancy (see 4.6.6 and 18.1.1.4) Exception: The requirement of 18.1.1.1.1 shall not apply to additions classified as occupancies other than health care that are separated from the health care occupancy in accordance with 18.1.2.1(2) and conform to the requirements for the specific occupancy in accordance with Chapters 12 through 17 and Chapters 20 through 42, as appropriate.(3) Alterations, modernizations, or renovations of existing health care occupancies (see 4.6.7 and 18.1.1.4) (4) Existing buildings or portions thereof upon change of occupancy to a health care occupancy (see 4.6.11) Exception*: Facilities where the authority having jurisdiction has determined equivalent safety has been provided in accordance with Section 1.5.

我想按以下顺序动态显示

本章的要求适用于以下方面:

(1) New buildings or portions thereof used as health care occupancies (see 1.4.1)

 (2) Additions made to, or used as, a health care occupancy (see 4.6.6 and 18.1.1.4) 

Exception: The requirement of 18.1.1.1.1 shall not apply to additions classified as occupancies other than health care that are separated from the health care occupancy in accordance with 18.1.2.1(2) and conform to the requirements for the specific occupancy in accordance with Chapters 12 through 17 and Chapters 20 through 42, as appropriate.

(3) Alterations, modernizations, or renovations of existing health care occupancies (see 4.6.7 and 18.1.1.4) 

(4) Existing buildings or portions thereof upon change of occupancy to a health care occupancy (see 4.6.11) Exception*: Facilities where the authority having jurisdiction has determined equivalent safety has been provided in accordance with Section 1.5.

当我在javascript中执行此操作时。 我在section_data.title中获得此内容的位置。 我该如何处理。

我觉得您的换行符不在html中。 尝试使用str_replace('\\n', '<br>', $queryResultString); 在将其编码为JSON之前将其写入PHP(将$ queryResultString替换为您通过JSON发送的任何字符串)。

让我知道这是否可行,或者我们可以尝试其他方法。

使用JavaScript方法“ String [] split(String regex)”根据正则表达式拆分字符串并将其存储在数组中。然后,您可以添加Breakline标签对其进行格式化。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM