I have a function that takes a country name and passes it to a processing page via the load() function.
In the following example the country is "American Samoa"
function loadRates(oArg) {
var Destination = oArg.Destination.toString() || '';
alert(Destination); // Alerts "American Samoa"
var uniqueid = new Date().getTime();
$('#divRates2').html('<img src="/images/ajax-loader.gif">').load('inc_rates_output.cfm?Destination=' + Destination + '&uniqueid=' + uniqueid);
}
However, the processing page (inc_rates_output.cfm) receives the Destination url variable as "American", i.e. without the "Samoa".
Any ideas appreciated.
encodeURIComponentonDestinationbefore adding it to the url.load('inc_rates_output.cfm?Destination=' + encodeURIComponent(Destination) +