build a querystring within class file throws js unterminated string literal

Hello all,

I have a page that is partially built from within a method.

String theLink ="FeedFilePusher";//My servlet

itemGeoLink ="<a href='#' onclick=top.alertMe('"+theLink+"')>CLICK</a>";

The above works fine.

The problem is that I need to pass a querystring to this servlet.

String theLink ="FeedFilePusher?title=" + itemTitle +"&summary=" + itemDesc +"&link=" + entry.getLink() +"&updated=" + itemDate;

itemGeoLink ="<a href='#' onclick=top.alertMe('"+theLink+"')>CLICK</a>";

When I add the querystring values it throws a unterminated string literal error from within firefox.

I tried to encode the ? and the & but that didnt work.

Any ideas on how to do this?

Here is the simple javascript function called alertMe.

function alertMe(url)

{

document.getElementById('mapframe').src = url;

closeBubble();

}

TIA!

[1310 byte] By [gfortya] at [2007-11-26 20:00:58]
# 1
Check if the resulting link has any ' or accented letters (衢鲷). That sometimes causes that error (at least i've seen it like.. 1000000 times writing spanish applications lol)Also, the URL.encode() method might help.
benubacha at 2007-7-9 22:59:02 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...