p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   onClick event not working !!! (http://p2p.wrox.com/showthread.php?t=20149)

muklee October 22nd, 2004 01:39 AM

I have try doing something like :
Code:

img.onclick = deleteItem("Delete");
so that, the function "deleteItem" will receive a parameter. But I get a javascript error message : obect require. So, is ut means that we cannot pass in any parameter(s) to the function "deleteItem".

Thanks a lot, guys.


ChrisScott October 22nd, 2004 02:23 AM

Hello muklee,

You could use
Code:

img.onclick = function(){deleteItem("Delete");};
or
Code:

img.onclick = new Function("deleteItem('Delete');");
HTH,

Chris


muklee October 22nd, 2004 02:35 AM

Excellent, finally the page is working well.
Thank you so much to all you, thanks.


pecal June 4th, 2008 03:46 AM

hello muklee
i meet the same problem,i try as ChrisScott said,i use the method

img.onclick = function(){deleteItem("Delete");};
and
img.onclick = new Function("deleteItem('Delete');");
but it does not work
My code:
function parseSubTree(id){
var el= document.getElementById(id);
var images = el.getElementsByTagName("IMG");
images[0].onClick=function(){showHide(id);};
}
i can't solve it ,hope to get some hlep from you



vinod_yadav1919 June 4th, 2008 04:08 PM

Hi All !!
There is solution and observations on this..
http://p2p.wrox.com/topic.asp?TOPIC_ID=71868

Cheers :)

vinod


All times are GMT -4. The time now is 04:04 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.