Solved

send a null variable javascript

Posted on 2012-04-07
4
260 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

747 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