Missing ) in parenthetical

Dear All,
I am reading data from database and putting it into table. So then in the table there is one column for button as below: The problem when I call click on the button it gives me this error missing ) in parenthetical. But if I check there is enough of parenthesis. Can any one suggest what is to be done?
<td><input type=‘button’ VALUE=‘Show’ onClick=‘getDetails(2741,POLYGON((101.37181520462036 3.0319049326758027,101.37638568878174 3.037904654235451,101.38091325759888 3.0346905218280065,101.37580633163452 3.0288407763236367,101.37166500091553 3.031712083930465,101.37181520462036 3.0319049326758027)))’></td>

I don’t think you can pass a parameter which is two numbers with a space between them.
I suppose you’ll have to either pass it as a string, or as an object…
Can you please show us the polygon function ?

Dear Philiptoop,
Yes the second arguement should be “POLYGON()” as a string. So how much I code my values? Thank you.

onclick is calling a javascript function getDetails. This function has two arguments 2741 and POLYGON(). POLYGON would be treated (if its argument list was correct) as a javascript function with its arguments with brackets. For javascript this argument list must be comma delimited.

Perhaps what you mean is that the second argument is “POLYGON()” that is a string.

Dear Philiptoop,
No there is no comma. The data I get from database is actually in this format POLYGON((101.37181520462036 3.0319049326758027,101.37638568878174 3.037904654235451,101.38091325759888 3.0346905218280065,101.37580633163452 3.0288407763236367,101.37166500091553 3.031712083930465,101.37181520462036 3.0319049326758027)). So it fits well in the opening and closing parenthesis?

Shouldn’t there be a comma between the numbers beginning 101 and the numbers beginning 3.

101.37181520462036 3.0319049326758027

should be

101.37181520462036, 3.0319049326758027

Dear Wolken,
Thank you it works now.

You’ll have to escape the double quotes.
I don’t know the server language you’re using, but I suppose it would be something like this:


geoFenceTableContent = geoFenceTableContent+"<td><input type='button' VALUE='Show' onClick='getGeoFenceDetails("+geoFenceDetails.geoFenceID+",\\""+geoFenceDetails.geoFenceString+"\\")'></td>";

Dear Wolken,
Below is my code
geoFenceTableContent = geoFenceTableContent+“<td><input type=‘button’ VALUE=‘Show’ onClick='getGeoFenceDetails(”+geoFenceDetails.geoFenceID+“,”+geoFenceDetails.geoFenceString+“)'></td>”;
How can I put the double quote around the geoFenceDetails.geoFenceString value? Thank you.

you mean something like that ?


<td><input type='button' VALUE='Show' onClick='getDetails(2741,"POLYGON((101.37181520462036 3.0319049326758027,101.37638568878174 3.037904654235451,101.38091325759888 3.0346905218280065,101.37580633163452 3.0288407763236367,101.37166500091553 3.031712083930465,101.37181520462036 3.0319049326758027))")'></td>

Dear Wolken,
No I want to pass the POLYGON as a string not function? How can I do that? Thank you.