|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript function call from PHP
I am trying to call Javascript function from PHP code and it is not working.Any help is appreciated.
Thanks. |
|
#2
|
|||
|
|||
|
JavaScript is working on the client side and PHP on server side
For JavaScript to work on server side there is a lib which can be used (JSON) You can find all you need here all the best |
|
#3
|
|||
|
|||
|
Javascript function to run on client side?
Thanks macanicu for your kind reply.I want the Javascript function to run on client side,as shown in the code:
<script type="text/javascript" language="javascript"> function change(name) { document.getElementById("but").src = document.getElementById(name).src; } </script> <? echo " <IMG src=\"$row[photopath]\" WIDTH=\"75\" HEIGHT=\"75\" TITLE=\"Click to Enlarge\" id=\"$name\" onClick=\"change($name)\"/> "; ?> Sorry for taking time of you.I am doing website for the first time. |
|
#4
|
|||
|
|||
|
Some tools for you
I don't see right now where your error is but there are some tools which are very useful in this development.
For the client size is firebug (you can find it here) and for the server part is firePHP (you can find it here) In order to re-size your image you will want that the big image is downloaded only on click, so you Will need to send this request to the server which must know how to react on this This can be done by submitting the page or by using AJAX technology (submit only needed part of the page). Some good tips on AJAX technology you can find here A quick test for your function can be done with PHP Code:
Hope it helps |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Javascript function call from PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|