i am trying to open a feedback window and put some js code inside. this is what i did:
$('#feedback').click(function(){
mw = window.open('','','width=560,height=460');
mw.document.write('<html><head>');
mw.document.write('<sc'+'ript type="text/javascript" src="{{STATIC_URL}}js/jquery-1.9.0.js"></scri'+'pt>');
mw.document.write('<sc'+'ript type="text/javascript"> function feedbacken(){'+
'var catg = $("#catg").text(); var feedback = $("#feedback").text(); alert(catg feedback);'
+'}</scri'+'pt>');
mw.document.write('</head><body>');
mw.document.write('<div style="padding-left: 30px;">');
mw.document.write('<br/> Bitte wählen Sie die Kategorie aus: <br/> ');
mw.document.write('<select id="catg"><option>--</option><option>Technisch</option> <option>Inhalt</option><option>Design</option></select>');
mw.document.write('<br/><br/>Hier bitte Ihr Feedback:');
mw.document.write('<p><textarea id="feedback" style="width:400px;height:100px"> </textarea></p>');
mw.document.write('<button onclick="feedbacken()"> Jetzt absenden </button>');
mw.document.write('</div>');
mw.document.write('</body></html>');
});
now, window is opening fine, but once i click the button, it is saying. feedbacken()
function isnot defined.
can someone please hack this for me :)
this my feedback element:
<a id="feedback">Feedback</a>