PDA

View Full Version : javascript error with PHP...


moorehed
04-12-2004, 01:32 PM
this is strange...

i downloaded a javascript and am attempting to integrate it with my php generated page... i am getting this error when php generates the page:

Line: 1
Char: 1
Error: 'myEditor.document.body' is null or not an object
Code: 0
URL: http://localhost/php/php.exe/dev/logon/main.php

however, when i view source, copy and paste it into a new file and save it as an htm file, then open that it doesn't give an error...

in both cases everything works as it should... just gives me an anoying error when i use it through php... why would this happen? it doesn't seem to me like there should be a difference.

agent002
04-12-2004, 01:44 PM
please give us a link... other than the localhost link :)

moorehed
04-12-2004, 02:28 PM
it isn't really available to the public... as it requires a login and such... hmm i just dont' see why things should be any different if it's a .php file?

agent002
04-12-2004, 02:35 PM
it's hard to help without any code. But 'myEditor.document.body' tells me that there is a frame or an iframe with the name 'myEditor'?

moorehed
04-12-2004, 05:18 PM
yeah, i am using a script that creates an iframe... i could post the source tomorrow... it just seems odd that the code woudl cause an error as a php file and not when i put it into an htm file...

Josh
04-12-2004, 05:24 PM
It could be something to do with addslashes or stripslashes or htmlentities. But we need to see the code.