I there an online tool to convert HTML into a string? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is there an online tool to convert HTML code line per line into a string by putting quotation marks around it? I nee HTML code as String to use it within a JS file in order to inject it into the DOM on demand.
String
"<div class=\"my\"> as a String </div>"
+"<img>"

You could try with JS?
HTML to JS (click)

Related

Converting octave code to js without having to rewrite everything [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have coded some octave code and have been thinking of turning it into JS so that I will be able to run it on a website. How would this be able to be done without having to completely rewrite the code?
Use a tool like matscript or just make a server side solution

How to split up a js file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a problem where I can't upload a js file to GitHub because it is too large. Is there a way to split it into multiple smaller files that still work in the same way?
Instead of splitting the file, use Git LFS
https://git-lfs.github.com/

How can I decode this JavaScript code? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to decode the following script but can't seem to get it in working state.
I tried to decode it on http://ddecode.com/hexdecoder/ but can't understand the first few lines.
var _0x2a14=["\x7B","\x73\x70\x6C\x69\x74","\x6C\x65\x6E\x67\x74\x68\x7B\x2E\x75\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x57\x72\x61\x70\x70\x65\x72\x2C\x2E\x66\x62\x55\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x7B\x70\x61\x72\x65\x6E\x74\x73\x7B\x68\x61\x73\x2D\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x7B\x61\x64\x64\x43\x6C\x61\x73\x73\x7B\x6E\x65\x78\x74\x7B\x2E\x75\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x3A\x6C\x61\x73\x74\x7B\x66\x69\x6E\x64\x7B\x76\x69\x64\x65\x6F\x7B\x68\x61\x73\x7B\x77\x69\x64\x74\x68\x7B\x61\x74\x74\x72\x7B\x64\x61\x74\x61\x2D\x76\x69\x64\x65\x6F\x2D\x69\x64\x7B\x5B\x64\x61\x74\x61\x2D\x76\x69\x64\x65\x6F\x2D\x69\x64\x5D\x7B\x69\x73\x4E\x75\x6D\x65\x72\x69\x63\x7B\x68\x72\x65\x66\x7B\x61\x5B\x72\x65\x6C\x3D\x74\x68\x65\x61\x74\x65\x72\x5D\x7B\x24\x31\x7B\x72\x65\x70\x6C\x61\x63\x65\x7B\x61\x6A\x61\x78\x69\x66\x79\x7B\x65\x61\x63\x68\x7B\x61\x7B\x76\x61\x6C\x7B\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x66\x74\x5F\x65\x6E\x74\x5F\x69\x64\x65\x6E\x74\x69\x66\x69\x65\x72\x5D\x7B\x3C\x64\x69\x76\x20\x69\x64\x3D\x27\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2D\x7B\x27\x20\x63\x6C\x61\x73\x73\x3D\x27\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x27\x3E\x7B\x3C\x66\x69\x65\x6C\x64\x73\x65\x74\x3E\x7B\x3C\x6C\x65\x67\x65\x6E\x64\x3E\x7B\x3C\x61\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x68\x72\x65\x66\x3D\x27\x68\x74\x74\x70\x73\x3A\x2F\x2F\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x27\x20\x74\x69\x74\x6C\x65\x3D\x27\x46\x61\x63\x65\x62\x6F\x6F\x6B\x20\x56\x69\x64\x65\x6F\x20\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x20\x2D\x20\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x66\x61\x63\x65\x62\x6F\x6F\x6B\x20\x76\x69\x64\x65\x6F\x27\x3E\x7B\x3C\x69\x6D\x67\x20\x63\x6C\x61\x73\x73\x3D\x27\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2D\x6C\x6F\x67\x6F\x27\x20\x73\x72\x63\x3D\x27\x68\x74\x74\x70\x73\x3A\x2F\x2F\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2F\x66\x61\x76\x69\x63\x6F\x6E\x73\x2F\x66\x62\x76\x69\x64\x65\x6F\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2F\x66\x61\x76\x69\x63\x6F\x6E\x2D\x33\x32\x78\x33\x32\x2E\x70\x6E\x67\x27\x20\x2F\x3E\x7B\x50\x6F\x77\x65\x72\x65\x64\x20\x62\x79\x20\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x7B\x3C\x2F\x61\x3E\x20\x7B\x3C\x2F\x6C\x65\x67\x65\x6E\x64\x3E\x7B\x3C\x64\x69\x76\x3E\x7B\x43\x61\x6E\x27\x74\x20\x67\x65\x74\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x6C\x69\x6E\x6B\x73\x20\x6F\x66\x20\x74\x68\x69\x73\x20\x76\x69\x64\x65\x6F\x20\x6F\x6E\x20\x6E\x65\x77\x73\x66\x65\x65\x64\x2E\x20\x3C\x62\x72\x20\x2F\x3E\x7B\x50\x6C\x65\x61\x73\x65\x20\x72\x69\x67\x68\x74\x20\x63\x6C\x69\x63\x6B\x20\x6F\x6E\x20\x76\x69\x64\x65\x6F\x20\x2D\x3E\x20\x53\x68\x6F\x77\x20\x76\x69\x64\x65\x6F\x20\x55\x52\x4C\x20\x2D\x3E\x20\x43\x6F\x70\x79\x20\x55\x72\x6C\x20\x2D\x3E\x20\x50\x61\x73\x74\x65\x20\x55\x72\x6C\x20\x74\x6F\x20\x6E\x65\x77\x20\x74\x61\x62\x2E\x20\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x62\x75\x74\x74\x6F\x6E\x73\x20\x77\x69\x6C\x6C\x20\x62\x65\x20\x73\x68\x6F\x77\x6E\x20\x75\x6E\x64\x65\x72\x20\x76\x69\x64\x65\x6F\x2E\x20\x3C\x62\x72\x20\x2F\x3E\x7B\x49\x66\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x62\x75\x74\x74\x6F\x6E\x73\x20\x68\x61\x76\x65\x6E\x27\x74\x20\x73\x68\x6F\x77\x6E\x2C\x20\x70\x6C\x65\x61\x73\x65\x20\x3C\x61\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x68\x72\x65\x66\x3D\x27\x68\x74\x74\x70\x73\x3A\x2F\x2F\x63\x68\x72\x6F\x6D\x65\x2E\x67\x6F\x6F\x67\x6C\x65\x2E\x63\x6F\x6D\x2F\x77\x65\x62\x73\x74\x6F\x72\x65\x2F\x64\x65\x74\x61\x69\x6C\x2F\x61\x77\x65\x73\x6F\x6D\x65\x2D\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2D\x76\x69\x64\x65\x6F\x2D\x64\x6F\x2F\x6B\x6D\x6D\x69\x6E\x6A\x6F\x6F\x65\x6D\x6D\x68\x68\x62\x70\x6B\x62\x66\x6D\x6A\x68\x6B\x6E\x66\x66\x70\x6C\x6D\x6A\x6B\x66\x69\x2F\x73\x75\x70\x70\x6F\x72\x74\x27\x3E\x72\x65\x70\x6F\x72\x74\x20\x74\x6F\x20\x64\x65\x76\x20\x74\x65\x61\x6D\x3C\x2F\x61\x3E\x2E\x7B\x3C\x2F\x64\x69\x76\x3E\x7B\x3C\x2F\x66\x69\x65\x6C\x64\x73\x65\x74\x3E\x7B\x61\x66\x74\x65\x72\x7B\x76\x69\x64\x65\x6F\x49\x64\x7B\x76\x69\x64\x65\x6F\x55\x72\x6C\x7B\x68\x74\x74\x70\x73\x3A\x2F\x2F\x77\x77\x77\x77\x2E\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2E\x63\x6F\x6D\x2F\x7B\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x55\x72\x6C\x7B\x68\x74\x74\x70\x73\x3A\x2F\x2F\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2F\x76\x69\x64\x65\x6F\x73\x2F\x7B\x68\x64\x7B\x2F\x76\x69\x64\x65\x6F\x2D\x68\x64\x2E\x6D\x70\x34\x7B\x73\x64\x7B\x2F\x76\x69\x64\x65\x6F\x2D\x73\x64\x2E\x6D\x70\x34\x7B\x23\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2D\x7B\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x27\x63\x6C\x65\x61\x72\x66\x69\x78\x27\x3E\x7B\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x27\x70\x75\x6C\x6C\x2D\x6C\x65\x66\x74\x27\x3E\x7B\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x27\x70\x75\x6C\x6C\x2D\x72\x69\x67\x68\x74\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x2D\x62\x75\x74\x74\x6F\x6E\x73\x27\x3E\x20\x3C\x62\x3E\x4C\x6F\x61\x64\x69\x6E\x67\x20\x2E\x2E\x2E\x3C\x2F\x62\x3E\x7B\x3C\x64\x69\x76\x20\x73\x74\x79\x6C\x65\x3D\x27\x6D\x61\x72\x67\x69\x6E\x2D\x74\x6F\x70\x3A\x20\x35\x70\x78\x3B\x20\x74\x65\x78\x74\x2D\x61\x6C\x69\x67\x6E\x3A\x20\x72\x69\x67\x68\x74\x27\x3E\x7B\x2D\x2D\x2D\x20\x6F\x72\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x66\x72\x6F\x6D\x20\x7B\x3C\x61\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x68\x72\x65\x66\x3D\x27\x7B\x27\x20\x74\x69\x74\x6C\x65\x3D\x27\x56\x69\x64\x65\x6F\x20\x55\x72\x6C\x27\x3E\x7B\x68\x74\x74\x70\x73\x3A\x2F\x2F\x77\x77\x77\x2E\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2E\x63\x6F\x6D\x2F\x76\x69\x64\x65\x6F\x2F\x65\x6D\x62\x65\x64\x3F\x76\x69\x64\x65\x6F\x5F\x69\x64\x3D\x7B\x73\x64\x5F\x73\x72\x63\x5F\x6E\x6F\x5F\x72\x61\x74\x65\x6C\x69\x6D\x69\x74\x3A\x22\x7B\x73\x70\x6C\x69\x74\x7B\x73\x64\x5F\x73\x72\x63\x5F\x6E\x6F\x5F\x72\x61\x74\x65\x6C\x69\x6D\x69\x74\x22\x3A\x22\x7B\x22\x7B\x2F\x7B\x68\x64\x5F\x73\x72\x63\x5F\x6E\x6F\x5F\x72\x61\x74\x65\x6C\x69\x6D\x69\x74\x3A\x22\x7B\x68\x64\x5F\x73\x72\x63\x5F\x6E\x6F\x5F\x72\x61\x74\x65\x6C\x69\x6D\x69\x74\x22\x3A\x22\x7B\x53\x44\x20\x69\x73\x6E\x27\x74\x20\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x7B\x3C\x61\x20\x63\x6C\x61\x73\x73\x3D\x27\x62\x74\x6E\x20\x62\x74\x6E\x2D\x64\x65\x66\x61\x75\x6C\x74\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x2D\x73\x64\x27\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x68\x72\x65\x66\x3D\x27\x7B\x27\x20\x74\x69\x74\x6C\x65\x3D\x27\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x53\x44\x20\x76\x69\x64\x65\x6F\x27\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x3D\x27\x46\x61\x63\x65\x62\x6F\x6F\x6B\x20\x76\x69\x64\x65\x6F\x20\x7B\x20\x53\x44\x20\x2D\x20\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2E\x6D\x70\x34\x27\x3E\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x53\x44\x3C\x2F\x61\x3E\x20\x7B\x48\x44\x20\x69\x73\x6E\x27\x74\x20\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x7B\x3C\x61\x20\x63\x6C\x61\x73\x73\x3D\x27\x62\x74\x6E\x20\x62\x74\x6E\x2D\x70\x72\x69\x6D\x61\x72\x79\x20\x74\x65\x78\x74\x2D\x62\x6F\x6C\x64\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x2D\x68\x64\x27\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x68\x72\x65\x66\x3D\x27\x7B\x27\x20\x74\x69\x74\x6C\x65\x3D\x27\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x48\x44\x20\x76\x69\x64\x65\x6F\x27\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x3D\x27\x46\x61\x63\x65\x62\x6F\x6F\x6B\x20\x76\x69\x64\x65\x6F\x20\x7B\x20\x48\x44\x20\x2D\x20\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2E\x6D\x70\x34\x27\x3E\u21E9\x20\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x48\x44\x3C\x2F\x61\x3E\x20\x7B\x68\x74\x6D\x6C\x7B\x20\x2E\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x2D\x62\x75\x74\x74\x6F\x6E\x73\x7B\x68\x74\x74\x70\x73\x3A\x2F\x2F\x77\x77\x77\x2E\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2E\x63\x6F\x6D\x2F\x7B\x54\x68\x69\x73\x20\x76\x69\x64\x65\x6F\x20\x64\x6F\x65\x73\x6E\x27\x74\x20\x68\x61\x76\x65\x20\x61\x6E\x79\x20\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x6C\x69\x6E\x6B\x73\x7B\x20\x53\x44\x20\x7B\x77\x7B\x78\x7B\x68\x7B\x20\x2D\x20\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2E\x6D\x70\x34\x27\x3E\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x53\x44\x3C\x2F\x61\x3E\x20\x7B\x20\x48\x44\x20\x7B\x20\x2D\x20\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2E\x6D\x70\x34\x27\x3E\u21E9\x20\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x48\x44\x3C\x2F\x61\x3E\x20\x7B\x67\x65\x74\x7B\x2E\x75\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x57\x72\x61\x70\x70\x65\x72\x2C\x2E\x66\x62\x55\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x3A\x6E\x6F\x74\x28\x2E\x68\x61\x73\x2D\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x29\x7B\x2E\x75\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x57\x72\x61\x70\x70\x65\x72\x7B\x2E\x66\x62\x55\x73\x65\x72\x43\x6F\x6E\x74\x65\x6E\x74\x7B\x31\x7B\x6C\x6F\x67\x7B\x61\x5B\x64\x61\x74\x61\x2D\x76\x69\x64\x65\x6F\x2D\x69\x64\x5D\x7B\x73\x64\x20\x68\x64\x7B\x2E\x6D\x74\x6D\x2E\x5F\x35\x70\x63\x6D\x3A\x6E\x6F\x74\x28\x2E\x68\x61\x73\x2D\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x29\x7B\x23\x70\x65\x72\x6D\x61\x6C\x69\x6E\x6B\x5F\x76\x69\x64\x65\x6F\x5F\x70\x61\x67\x65\x6C\x65\x74\x7B\x65\x78\x65\x63\x7B\x68\x61\x73\x43\x6C\x61\x73\x73\x7B\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x27\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x27\x20\x73\x74\x79\x6C\x65\x3D\x27\x6D\x61\x72\x67\x69\x6E\x2D\x62\x6F\x74\x74\x6F\x6D\x3A\x20\x31\x30\x70\x78\x27\x3E\x7B\x20\x50\x6F\x77\x65\x72\x65\x64\x20\x62\x79\x20\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x7B\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x27\x63\x6C\x65\x61\x72\x66\x69\x78\x27\x3E\x44\x6F\x77\x6E\x6C\x6F\x61\x64\x20\x74\x68\x69\x73\x20\x76\x69\x64\x65\x6F\x20\x61\x74\x20\x68\x65\x72\x65\x3A\x20\x7B\x3C\x61\x20\x74\x61\x72\x67\x65\x74\x3D\x27\x5F\x62\x6C\x61\x6E\x6B\x27\x20\x68\x72\x65\x66\x3D\x27\x68\x74\x74\x70\x73\x3A\x2F\x2F\x66\x62\x64\x6F\x77\x6E\x6C\x6F\x61\x64\x65\x72\x2E\x69\x6E\x66\x6F\x2F\x76\x69\x64\x65\x6F\x73\x2F\x7B\x70\x61\x72\x65\x6E\x74"];
If want to see the actual content, follow below steps :
Go to Google Chrome Console.
Copy your content and paste it.
Then print the variable using console.log(_0x2a14);
Below is what I got on my console.

Regular expression to replace string in javascripts [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
hi i have one XML file i just want to replace some path in XML.
XML hold path of some images like it has many record like below
tile5url="images/Balcony Sunset Pano_o_480_5.jpg"
so i just want to replace path . i just want to replace "images/" with some other path like "newfolder/images/" or anythings else i have used javascript to read XML using XMLHttpRequest object and generate responseText to read XML
Thanks
Try this:
/tile5url="(images\/[^"]+)"/
And replace with
tile5url="newfolder/$1"
Demo
http://regex101.com/r/gB4oT5

how to inject javascript without using script tags? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I cant use the script tags
It alerts when I do , which is only useful for testing.
It filters them out:
script > *
SCRIPT > SCRIPT
sCriPt > sCriPt
so, i try to use capital script tags
but it turns to:
*CRIPT>alert(1)</SCRIPT>
I have tried using multiple tags.
How can I inject regular javascript with this?
Oh, and I cant use quotes.
Just so you know, there is an XSS Cheat Sheet you can refer to.

Categories

Resources