bananalive
Jun 27th 2008, 9:58 am
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>
<a href="javascript:;" onClick="insertText()">test</a>
I just want to insert $textstring instead of var textstring ($textstring which is identified in php script)
Thanks in advance,
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>
<a href="javascript:;" onClick="insertText()">test</a>
I just want to insert $textstring instead of var textstring ($textstring which is identified in php script)
Thanks in advance,