EasyUI Forum
September 14, 2025, 12:14:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: HTML tag in messager alert window not parsed correct if Notation in XML used  (Read 12276 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: February 19, 2014, 01:53:09 AM »

We used the messager like this $.messager.alert("Error", msg, "error");

If we used the message like this all is fine
Code:
"HTTP Status 500 - error executing work<br>Caused by:<br>Objektname"

But if we use the following text with Notation in XML for special characters, the html tags not correct used. The break tag is shown here as text <br> in the alert window.

Code:
"HTTP Status 500 - error executing work&lt;br&gt;Caused by:&lt;br&gt; Objektname"
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 19, 2014, 08:17:24 PM »

Please try this:
Code:
var msg = 'HTTP Status 500 - error executing work&lt;br&gt;Caused by:&lt;br&gt; Objektname';
msg = msg.replace(/&/g,'<span>&</span>');
$.messager.alert('Error',msg,'error');
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #2 on: February 20, 2014, 05:54:37 AM »

Please try this:
Code:
var msg = 'HTTP Status 500 - error executing work&lt;br&gt;Caused by:&lt;br&gt; Objektname';
msg = msg.replace(/&/g,'<span>&</span>');
$.messager.alert('Error',msg,'error');

No, this is not working. I thing the EasyUi Dialog window should interpate the special HTML Tag notation.

This is working:
Code:
var msg = 'HTTP Status 500<strong> - error executing work&lt;br&gt;Caused by:&lt;br&gt; Objektname';
msg = msg.replace(/&lt;/gi,'<');
msg = msg.replace(/&gt;/gi,'>');
$.messager.alert('Error',msg,'error');

But this is only special for the following characters
&lt; is the char: <
and &gt; is the char: <
and so the String &lt;br&gt; is like <br>

I thing the dialog window should format the message correct for all special characters, while there are many special characters.
See: http://www.w3schools.com/html/html_entities.asp
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!