|
I don't know about Javascript, but for normal URL links you need to URL-encode all the parameters (not the parameter names, just the parameter values). That would change not only apostrophes but also pretty much anything other than letters or numbers. Including spaces. Your Javascript string would be produced like this: 'ListCustomers?civicno=" + URLEncoder.encode(sn.getCivic(p)) + "&unit=&street=" + URLEncoder.encode(street) + "' PC2 -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPower@xxxxxxxxxx Sent: June 1, 2005 06:00 To: Java Programming on and around the iSeries / AS400 Subject: One last bit of help I'm almost done my first REAL Java project. Here's my next question. Got the following line of code: out.println("<a href=\"javascript:customerSearch('ListCustomers?civicno=" + sn.getCivic(p) + "&unit=&street=" + street + "');\"><font size=\"1\"><img src=\"indent.gif\" border=\"0\"\"> " + sn.getCivic(p) + " " + name + "</font></a><br>"); Works great, except when street is "BELL'S TURN" and my link wants to truncate itself and it can't find the ending ")".
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.