Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old October 22nd, 2004, 01:39 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

  #12 (permalink)  
Old October 22nd, 2004, 02:23 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello muklee,

You could use
Code:
img.onclick = function(){deleteItem("Delete");};
or
Code:
img.onclick = new Function("deleteItem('Delete');");
HTH,

Chris

  #13 (permalink)  
Old October 22nd, 2004, 02:35 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #14 (permalink)  
Old June 4th, 2008, 03:46 AM
Registered User
 
Join Date: Jun 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to pecal
Default

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


  #15 (permalink)  
Old June 4th, 2008, 04:08 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

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

Cheers :)

vinod




Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate onclick event collie Javascript 4 May 27th, 2008 09:22 AM
onclick event bjackman Access 6 July 15th, 2004 06:54 AM
onclick event pigtail Javascript 1 April 11th, 2004 03:10 PM
onClick Event mateenmohd Javascript 4 December 16th, 2003 01:08 AM
onclick event not working? mumps Javascript 2 September 15th, 2003 10:09 AM





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