I’m a noob in Javascript but here is my problem:
I’m cleaning up some PHP-files. Some of them contain Javascript functions which I want to transfer to a separate xxx.js file.
Most of them are working fine again but one causes me trouble. I think because of the punctuation (the ‘ and “).
Here’s the script as it shows up IN the PHP-file:
function preview(){
dd=window.open('','prv','height=600,width=500,resizable=1,scrollbars=1')
document.addnews.mod.value='preview';document.addnews.target='prv'
document.addnews.submit();dd.focus()
setTimeout(\"document.addnews.mod.value='addnews';document.addnews.target='_self'\",500)
}
When copying this to the xxx.js file it won’t work.
Anybody knows how it should look in a real .js-file?
Thanks in advance!
Cleaned a bit: