Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

send a null variable javascript

Posted on 2012-04-07
4
Medium Priority
?
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 1020 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…
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…

715 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