我有JSON文件,其中包含要在我的移動應用程序中顯示的標籤和內容。使用JSON文件中的html標籤閱讀內容並在javascript中顯示
我使用$ .getJSON在本地項目中讀取JSON文件。它將返回JSON對象。使用該對象,我在Javascript中顯示標籤/文本內容。在顯示帶有html字符的內容時,它不能正確加載,仍然是它的顯示html字符。
裏面的內容JSON
"CONSENT_EMAIL_REQUEST_BODY" : "Please read the below content <br> Welcome to the project <br> you can now use the application."
如果我嘗試打印CONSENT_EMAIL_REQUEST_BODY的值在JavaScript它仍然顯示
Please read the below content <br> Welcome to the project <br> you can now use the application.
它不是由線顯示線突破
都顯示,因爲它是。如何替換這些html字符以在移動/瀏覽器中正確顯示。