Page 1 of 1

???Migration from JavaScript to PHP???

Posted: Sun Jun 27, 2004 6:10 am
by beath
hi

during the migration of some javascript-modules to PHP, i'm looking for a simple answer to the following question:

how can i access a defined value (image-source-value) of a defined object (identified by the id-attribute)?

HTML

Code: Select all

<img  &#1111;b]id&#1111;/b]="photoContainerImage" src="06_normal.jpg" width="400" height="300" class="photoFrame" />
JAVASCRIPT-implementation

Code: Select all

var currentImage = document.getElementById('photoContainerImage');
  currentHref = currentImage.src;
  Result currentHref -> 06_normal.jpg
8O ???PHP-implementation??? 8O

I'm aware of the fact, that client- and server-scripts are different things. regardless of this fact, i think it should be possible for PHP, to access the document-elements while parsing the document huh?

anyway, I'm thankful for any hint
hang loose

Re: ???Migration from JavaScript to PHP???

Posted: Sun Jun 27, 2004 9:25 am
by scorphus
Hi beath, welcome to DevNetwork Forums!
beath wrote:I'm aware of the fact, that client- and server-scripts are different things. regardless of this fact, i think it should be possible for PHP, to access the document-elements while parsing the document huh?
Anything in a PHP script is processed in server side, there is no way to run PHP in the client's browser, like JavaScript or ActionScript (Flash).

It seems to me you know the difference between server- and client-scripts. So you can figure out if you can migrate this part of the JavaScript or not.

Regards,
Scorphus.