If innerHTML contains spaces and carriage returns, it will be considered the end of the paragraph, causing program running errors. The solution is to replace spaces and carriage returns during output to facilitate js calls. The code is as follows:
Copy the code code as follows:
Function ReplaceEx(strOri,replStr)
Set regEx=New RegExp
regEx.Global=True
regEx.MultiLine=True
regEx.Pattern=/r/n
regEx.IgnoreCase=True
ReplaceEx=regEx.Replace(strOri,replStr)
End Function
shuoming=replace(rs(shuoming), , )
shuoming=ReplaceEx(shuoming,<br>)
In this way, there will be no errors when outputting after replacement! When I was processing it, I could use the replace function to replace spaces, but replacing carriage returns and line feeds never worked. I had to resort to regular expressions! !