I am running a program which loads a web page and injects some javascript into the page. I load the file as a string, and inject it into a particular script.
The original javascript has a section with an if clause with a <= conditional in it. Here's the original function.
$(".crossword").on('DOMSubtreeModified', function () {
//alert('changed')
if (receiveCount <= 0) {
if (guid && socketId) {
var grid = currentGridState();
socket.emit('new move', guid, socketId, grid);
}
} else {
if (receiveCount > 0) receiveCount--;
}
})
I inject the javascript after doing a file read.
$('#sockets').prepend(puzzleScript)
The javascript that ends up on the web page ends up modified to parse the <= as part of a tag. Why is this happening and how do I disable this behavior?
$(".xyz").on('DOMSubtreeModified', function () {
//alert('changed')
if (receiveCount <= 0) { if (guid && socketid) var grid="currentGridState();" socket.emit('new move', guid, socketid, grid); } else (receivecount> 0) receiveCount--;
}
....
</#></script>
I am running a program which loads a web page and injects some javascript into the page. I load the file as a string, and inject it into a particular script.
The original javascript has a section with an if clause with a
<=
conditional in it. Here's the original function.I inject the javascript after doing a file read.
The javascript that ends up on the web page ends up modified to parse the
<=
as part of a tag. Why is this happening and how do I disable this behavior?