Solved

send a null variable javascript

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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…
Suggested Courses

628 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