Solved

send a null variable javascript

Posted on 2012-04-07
4
262 Views
Last Modified: 2012-04-07
Is this the correct way to send a null variable.

<a href="javascript:void(0);" onclick="javascript:chooseClassGroup('G_FREE', 'null', 'FREE', 'Free Stuff');">Free Stuff</a>

Open in new window

0
Comment
Question by:Luey
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 255 total points
ID: 37820005
chooseClassGroup('G_FREE', '', 'FREE', 'Free Stuff')

Send null as an empty string.


Cd&
0
 
LVL 23

Expert Comment

by:basicinstinct
ID: 37820012
I think you mean you want to pass null as an argument to the function you are calling.

Remove the quotes around the null, like this:

<a href="javascript:void(0);" onclick="javascript:chooseClassGroup('G_FREE', null, 'FREE', 'Free Stuff');">Free Stuff</a>
0
 
LVL 23

Expert Comment

by:basicinstinct
ID: 37820018
and by the way you can simplify your whole link:

<a href="#" onclick="chooseClassGroup('G_FREE', null, 'FREE', 'Free Stuff');">Free Stuff</a>
0
 

Author Closing Comment

by:Luey
ID: 37820023
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now