0
Writing into the DOM using Javascript documentwrite()
I have some HTML code in a JavaScript variable. Suppose: let htmlCode = `<div>.....</div>` And the html code is displayed in required placed using document.write(htmlCode) But I need to do this without letting the person's that view the page source code that the code is actually written using document.write(). How, can I do this in such a way that it will write the code on same place where the JS code is placed and source code viewer won't know how the HTML code is being printed. I am pasting this code where I want the html code: script let htmlCode = "some HTML code in obfuscated form`m'; document.write(htmlCode); /script Any ideas.
2 Antworten
+ 4
you can use encryption
like I have used in this
https://code.sololearn.com/W1HytmSMVYu1/?ref=app
here you can see on the js tab
+ 1
I don't know how about js, but in django it is called template rendering
What about to use react?