[mapserver-users] Problem with Netscape treating a space different than Internet Explorer :
Tom Kralidis
tkralidi at CCRS.NRCan.gc.ca
Wed Sep 12 15:39:35 PDT 2001
Hi,
You may want to try a JavaScript call to figure out which browser is the client, i.e.:
<script language="JavaScript">
var newURL = "";
var myURL = "http://www.houstoneng.com/mapserv/cgi-bin/mapserv.exe?&map=[map]&template=printmap.html&layers=[layers]&mapext=[minx]+[miny]+[maxx]+[maxy]";
if (navigator.appName == "Netscape") {
// format URL to replace real spaces with the hex equivalent (%20)
newURL = myURL.replace(/ /g,"%20");
}
else {
newURL = myURL;
}
document.write(newURL);
</script>
Check the JavaScript documentation for the correct syntax on replacing substrings.
Hope this helps.
..Tom
You wrote...
>Date: Wed, 12 Sep 2001 16:44:27 -0500
>From: Brian Fischer <bfischer at mpls.houstoneng.com>
>To: mapserver-users at lists.gis.umn.edu
>Subject: [mapserver-users] Problem with Netscape treating a space
> different than Internet Explorer
>
>Mapserver community,
>
>I was wondering if anyone else has had this problem. I assume there
>must be a way around it, but can't find a solution.
>
>Here is the problem: I am using the [layers] cgi variable in a hyperlink
>like shown below.
>
>http://www.houstoneng.com/mapserv/cgi-bin/mapserv.exe?&map=[map]&templat
>e=printmap.html&layers=[layers]&mapext=[minx]+[miny]+[maxx]+[maxy]
>
>The problem is Netscape does not replace the space with a %20, but
>Internet Explorer does.
>
>Internet Explorer 5.5 URL:
>http://www.houstoneng.com/mapserv/cgi-bin/mapserv.exe?&map=projects/fgdc
>/mapviewer/mapviewer.map&template=printmap.html&layers=lakes%20Rivers%20
>Roads&mapext=-100.092035+47.222059+-94.531453+51.668504
>
>Netscape 4.7 URL:
>http://www.houstoneng.com/mapserv/cgi-bin/mapserv.exe?&map=projects/fgdc
>/mapviewer/mapviewer.map&template=printmap.html&layers=lakes Rivers
>Roads&mapext=-96.766990+48.008085+-95.278996+49.197928
>
>Any suggestions would be greatly appreciated.
>
>Thanks,
>Brian
>
>
More information about the MapServer-users
mailing list