Hi All,
I’m trying to do some basic segment checking and write out jQuery code dependant on those segments. The first if statement works and outputs the correct jQuery as expected, however when I do another segment check it actually writes out the values of those segments. Here’s my code:
[removed]
$(document).ready(function() {
{if segment_1 == "locations"}
// locations form jQuery
$('#ctl00_cphContent_address_qs').hide();
$('#txtFilter').hide();
$('#filter').click(function()
{
$('#checkBoxes').slideToggle();
});
{/if}
{if segment_1 == "locations" && segment_2 == "results"}
$('#ctl00_cphContent_address_qs').hide();
$('#ctl00_cphContent_submitbtn').hide();
$('#ctl00_cphContent_txtFilter').hide();
$('.business-filters').hide();
$('#cbxChangeFilters').click(function()
{
if ($('#cbxChangeFilters').is(':checked'))
{
$('.business-filters').show('slow');
}
else
{
$('.business-filters').hide('slow');
}
});
var zIndexNumber = 1000;
$('div').each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber += 10;
});
if($.browser.name == 'msie' && $.browser.versionX == 6)
{
$('#oldie6').html("You are using a browser that we no longer support. This page may therefore not look or function as we intended.
For a better web experience, we recommend that you upgrade your browser to the latest version.<ul class='browserList'><li><a href="http://www.mozilla-europe.org/en/firefox/">Mozilla Firefox</a></li><li><a href="http://www.google.com/chrome">Google Chrome</a></li><li><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Internet Explorer</a></li><li><a href="http://www.apple.com/safari/download/">Safari</a></li></ul>");
$('#oldie6').show();
}
{/if}
});
[removed]My line that states
{if segment_1 == "locations" AND segment_2 == "results"} outputs
{if "locations" == "locations" AND "results" == "results"}, as if the segments have already been parsed but the first segment check runs correctly and writes out the relevant code.
I’m using v1.6.9 build 20100430.
Any ideas why this is happening and any remedies?
Thanks,
Brett