Creating a variable to use in Javascript
I have created a web site with a search function where the user can use drop down menus. This is in a small window that pops up when you click Advanced Search. They choose the first drop down and then the next drop down appears and has items in it depending on what was chosen in the first drop down. This all works, except that it only works on our www. site. If you don't type in the www., then these drop down menus do not work. These drop downs use Javascript and in this javascript, I have the full path of our web site to the .cfm file where this is more javascript for the drop downs. This path has the www. in it. Does anyone know how I can write this so that both ways or paths work- with and without the www.? Do I need to set up some kind of variable to use? How do I do that in Javascript. I think I can do it in Cold Fusion, but I don't think that will work inside the javascript. The web site is www.ironwoodelectronics.com Here is the javascript code below. Thanks.
Andy
<script>
function getICNumber() {
$('#ICNumber').load("http://www.ironwoodelectronics.com/incICNumber.cfm",{ManufacturerID:$('#select_ManufacturerID').val()});
}
function getPackage() {
$('#Package').load("http://www.ironwoodelectronics.com/incPackage.cfm",{ManufacturerID:$('#select_ManufacturerID').val(),ICNumber:$('#select_IC_Number').val()});
}
function getPackageType() {
$('#PackageType').load("http://www.ironwoodelectronics.com/incPackageType.cfm",{FunctionID:$('#select_FunctionID').val()});
$('#Pitch').html("");
}
function getPitch() {
$('#Pitch').load("http://www.ironwoodelectronics.com/incPitch.cfm",{FunctionID:$('#select_FunctionID').val(),PackageID:$('#select_PackageID').val()});
}
function getBody() {
$('#Pitch').load("http://www.ironwoodelectronics.com/incPitch.cfm",{FunctionID:$('#select_FunctionID').val(),PackageID:$('#select_PackageID').val(),PitchID:$('#select_PitchID').val()});
}
function getArray() {
$('#Pitch').load("http://www.ironwoodelectronics.com/incPitch.cfm",{FunctionID:$('#select_FunctionID').val(),PackageID:$('#select_PackageID').val(),PitchID:$('#select_PitchID').val(),BodyID:$('#select_BodyID').val()});
}
</script>
