Forum Moderators: open
This is the code I am writing:
<script type="text/javascript">
function dropTag(droptag) {
var loc = window.location.toString();
var components = loc.split('/');
var tagstring = components[4];
var tagarray = tagstring.split(',');
if (tagarray.length == 1) {
window.location = "http://www.google.com";
} else {
var i = 0;
var remainingtags = new Array;
while (i < tagarray.length) {
if (droptag!= tagarray[i]) {
remainingtags.push(tagarray[i]);
}
i++;
}
tagstring = remainingtags.join(',');
components[4] = tagstring;
loc = components.join('/');
alert(loc);
window.location = loc;
}
}
</script>
The code works fine in Firefox. Can anyone spot my mistake? I checked various websites, but there are no indications of what I did wrong. Please help!