jondo Posted March 23, 2007 Share Posted March 23, 2007 Hi, I have recently been introduced to the Document Object Model in javascript however as cross browser compatibility is such an issue I was wondering if the same things or some of the same things can be accomplished in php? cheers Link to comment https://forums.phpfreaks.com/topic/44021-accessing-page-elements/ Share on other sites More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 To an extent yes, but essentially no. Javascript is unique in the way it handles information and is done on the Client-side whereas php is done on the server-side. Depending on what you want to do it could be yes and it could be no. Link to comment https://forums.phpfreaks.com/topic/44021-accessing-page-elements/#findComment-213735 Share on other sites More sharing options...
jondo Posted March 23, 2007 Author Share Posted March 23, 2007 well is there an equivalent of eg using getElementById() to get a division then changing it's css? Link to comment https://forums.phpfreaks.com/topic/44021-accessing-page-elements/#findComment-213760 Share on other sites More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 No, PHP is strictly server-side. In order to do that you would have to post back to the server with a submit button or a link of some sort. All PHP processing is done before the client sees it. Where JS Processing is done on the page itself and does not require post-backs for the most part. Link to comment https://forums.phpfreaks.com/topic/44021-accessing-page-elements/#findComment-213772 Share on other sites More sharing options...
jondo Posted March 23, 2007 Author Share Posted March 23, 2007 i see could they add a DOM system which created javascript at runtime for the browser executing the script? Link to comment https://forums.phpfreaks.com/topic/44021-accessing-page-elements/#findComment-213873 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.