×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 109757826, Entry date: 09/20/2018
(0)
Rate

Why are the special characters not displayed correctly in the HTML pages of the S7-1500 CPU when the file is opened via AJAX?

  • Entry
  • Associated product(s)
Unlike the browser, the data in the AJAX request is not decoded automatically. In this case you have to decode the data yourself as shown in the following example.

Description
AJAX (Asynchronous JavaScript and XML) is the asynchronous data transmission between client and server. An HTTP request is sent without forcing complete reloading of the page. Only those parts that are really needed are reloaded.

The web server of the CPU delivers the HTML pages in which for security reasons all the dynamic content (DTL values, for example) is encoded in HTML. The content is decoded automatically by the HTML client (browser) and therefore displayed correctly.

There is no automatic decoding in the AJAX request. You have decode the data yourself in this case if you need it. Fig. 1 shows an example for the time format "DTL#2018-04-23-06:25:01.778732551" when you open the file via AJAX.
 


Fig. 1

Remedy
The following Java script code shows you how you can decode the data using the function "htmlDecode()":
 

 <script type="text/javascript">
 function htmlDecode(input)
 {
 var doc = new DOMParser().parseFromString(input, "text/html");
 return doc.documentElement.textContent;
 }
 alert(':="MyDB".myDTLvalue:');
 document.write(htmlDecode(':="MyDB".myDTLvalue[3]:'));
 </ script>




Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit
Related links