Re: Using javascript function from php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux