| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | insert php code into javascript I've made a javascript and would like to know how to echo a value into the script. Code: iView.document.body.innerHTML = '<? echo $source; ?>'; Any ideas?
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |
| | #2 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | That should work if $source has a value. It should replace $source with whatever it's value is. So if you had something like: PHP Code: Code: iView.document.body.innerHTML = 'YourValue'; ![]() If it's just printing out <? echo $source; ?> then you may not have the short_open_tag enabled. |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Aug 2003 Location: Canada
Posts: 1,257
![]() ![]() ![]() ![]() | source did have a value... i registered it as a session too.
__________________ Near Fantastica | Matthew Good - Vancouver TS Design Group - Vancouver, BC based Graphic Design >> Do you Frawlik? << |
| |
| | #4 (permalink) |
| Senior Member Join Date: Aug 2002
Posts: 1,255
![]() ![]() | Well like I mentioned above maybe your short_open_tag isn't enabled or something if you're sure their was a value in the variable. It could also be a problem with register_globals or the way you're assigning the value or something like that. Otherwise it would print it to the browser just like you expect. I would need to see how you're getting the values and such to see what's really going on. |
| |