Solved

send a null variable javascript

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery force form POST 7 55
Character counter breaks after adding EmojiOne Area 4 25
javascript - insert into js doc help 2 25
Autocomplete with Jquery Question 2 21
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…
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…

820 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