Im coding a Chrome extension and tried injecting some code like this:
var actualCode = ['$("a").unbind("click");'].join('\n');
var script = document.createElement('script');
script.textContent = actualCode;
(document.head||document.documentElement).appendChild(script);
script.parentNode.removeChild(script);
I have the code from this question
The problem is that I have to use double quotes which relates to a right click from the context menu, so the code become:
Injecting-Code: "var actualCode = ['$("a").unbind("click");'].join('\n');"
How do I handle the double quotes in my Jquery: $("a").unbind("click");
Note : I tried escaping them like this \" but it doesnt work