Reply to Re: [PHP] Using javascript function from php

Your name:

Reply:


Posted by Richard Lynch on 10/19/22 11:10

> I am just learning php, and am currently converting some jsp pages to php.
> I used the follwing code in jsp to toggle between two images

Instead of driving yourself nuts with echo and quote and backslash and
semi-colon quote semi-colon, just do like this:

<?php
//PHP code here
?>
<!-- Look ma! No PHP -->
> <SCRIPT type="text/javascript" language=javascript>
> function toggle(imagename,src1,src2){
> if(document.images && document.images[imagename])
> {
> image1=new Image;
> image1.src=src1;
> if(document.images[imagename].src !=
> image1.src){document.images[imagename].src = image1.src}
> else{document.images[imagename].src=src2}
> }
> }
> </SCRIPT>
<?php
//more PHP here
?>

The hair you save, may be your own.

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация