Problem with javascipt + operator

Hi,

I am using the following javascript method inside a js file.

function createDivRow(label,text) {

var formedTd = '<tr><td>' + label + '</td><td> <a href="#" onclick="javascript:eventHandlerFunction("'+text+'")">'+text+'</a></td></tr>';

return formedTd;

}

But it's throwing syntax error.

I have tried the following way also.

function createDivRow(label,text) {

var formedTd = '<tr><td>' + label + '</td><td> <a href="#" onclick="javascript:eventHandlerFunction('+text+')">'+text+'</a></td></tr>';

return formedTd;

}

this version throwing ')' expected and also, the value of text which i am passing dynamically is undefined.

I am using IE6. can any one help me....

[871 byte] By [haijdpa] at [2007-11-27 6:34:28]
# 1
JavaScript is not Java. You should check at some JavaScript forums.
nogoodatcodinga at 2007-7-12 18:00:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
As this forum is the web tier section,thought of many web developers come into this and expected the reply.Thanks for your suggestion....:)
haijdpa at 2007-7-12 18:00:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

> As this forum is the web tier section,

> thought of many web developers come into this and

> expected the reply.

>

> Thanks for your suggestion....:)

Well, it is....but it is supposed to be specific to Java. And while people do know JavaScript ( for example, I do too, but only a little ), I'd expect that you'd get help faster and probably from people who know more about it.

:)

nogoodatcodinga at 2007-7-12 18:00:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...