I used XMLHttpRequest() to get C source code from server.
return HttpResponse(code, mimetype='text/x-c')
and I got correct source code when I checked it using alert(code).
like this
enter code here
#include<stdio.h>
int main(){
.....
}
and I split it into each lines in javascript.
var arr = code.split('\n');
window.document.getElementById("id").innerHTML = arr;
the result is like this.
#include
,int main(){
, ....
,}
I can't find <stdio.h>
I don't know why.... I dont think it's because of '<' character.
Cuz in for loop, I can find '<' character.
what's the problem?
` blocks can still contain other HTML. For example, it must process `` or `` tags. Therefore `` will be interpreted as a HTML tag. Scott gave you the solution - convert `<` to `<`. See the link he gave you.
– slebetman Sep 26 '13 at 05:26