This looks perfectly valid, since your JS call here is apparently in the JSP. I don't think your problem lies in the script (although I assume you have a onclick handler, not a onKlick one�), but that you do not have a strMap variable handy in this context (or that this variable's toString method doesn't match your purpose).
You should double-check the presence and nature of this variable in your active scopes.
It's not a JS issue, it's a HTML issue. The inline JS is an attribute value, and the attribute is delimited by double quotes, so putting double quotes in there breaks the attribute value (I should have seen it!).
The event handler's inline JS goes something like "insertText(", which obviously breaks.
Yet another reason why you should do away with inline JS and go unobtrusive�
It's really funny how sometimes you miss something that's really basic and elementary :roll: . Sorry for the double post earlier, but when I get those 503 and network error pages, I resubmit my post. I'll try to delete one of the two posts.
Originally posted by Christophe Porteneuve: Yet another reason why you should do away with inline JS and go unobtrusive�
So rather than declaring the onclick handler inline with the elements, it should be declared in the window onload handler or the document-ready handler.
Using the star of the week, Prototype:
And in jQuery:
Using either of Prototype or jQuery is highly recommended as both do a pretty good job of insulating you from the bumps of browser differences.