javascript - jQuery html() does ignore element naming (lower and bigger case) -


the .html() function jquery turn xml code lowercase.

is there other method can receive output expecting?

html = $('pre').html(); 

goal receive following output:

<ok:list title="helloworld"></ok> 

what receive:

<ok:list title="helloworld"></ok> 

complete code:

<!doctype html> <html> <head>   <title>test</title>     <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>     <script>     $(document).ready(function(){       var html = $('pre').html();       console.log(html);     });     </script> </head> <body> <pre>   <ok:list title="helloworld"></ok> </pre> </body> </html> 

i know xml standard lowercase. in situation can't change xml part. need solution can have wrong.xml displayed 'wrongly'.

check out this fiddle.

it's not standard if put xml textarea can retrieve via .val();

i.e. html like:

<textarea id="my-xml">    <example>       <node>text</node>    </example> </textarea> 

then in javascript/jquery:

var myxml = $('#my-xml').val(); //my have case sensitive xml 

found here.


Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -