Hi.. I've got some code I wrote in PHP that will generate a new argument
string for the browser, but the xhtml parser in Firefox and Opera both
complain about my use of &var=value pairs.
Below is my code that generates the string :
function InvokeURL(url_to_forward_to)
{
try
{
var xfamElem = document.getElementById('xFamily');
var mainform = document.getElementById('mainform');
var new_url = url_to_forward_to + "&variable=" + xfamElem.value;
mainform.action = new_url;
mainform.submit();
}
catch(error)
{
alert("InvokeURL encountered an error :" + error.description);
}
}
This works fine with *many* browsers except the new ones.. With IE on
windows (IE6) and Opera, Firefox all complain, Safari and some older
browsers seem to work OK..
If I change the line with the new_url variable setting on it to use a
& instead, it passes the XHTML tests but no longer works at all.. When
using the & it still has that in the URL that shows in the address
bar and hence it seems to cause the script on the other end a lot of
problems as it is unable to properly parse the URL string.
Any ideas on how to portably get around this problem with embedded &
created URL's?
Many thanks in advance!
-- Rick