how can i include a php variable (eg. $textstring) into javascript function Here's the code: <script> function insertText() { var textstring = "test string"; document.getElementById ("{$editorid}_iframe").contentWindow.document.body.innerHTML += textstring; document.getElementById('vB_Editor_001_textarea').value += textstring; } </script> Code (markup): <a href="javascript:;" onClick="insertText()">test</a> HTML: I just want to insert $textstring instead of var textstring ($textstring which is identified in php script) Thanks in advance,
When $textstring is more than 1 line it doesnt work, is there a way around this? using \n doesnt work for iframes and it would make the line too long EDIT: Found solution