views:

25

answers:

1

Hi There

I have a problem with a load function in jquery i try to call data from an url, images and text but this is not working in IE but is working with Firefox

Something like this

function loadProperties(propertiesPage) {
    $('#properties .content').slideUp(500);
    $('#properties .content').load('url' + propertiesPage, function () {
        $('.video a').colorbox({
            width: 800,
            height: '100%',
            iframe: true
        });
        $('#properties .content').slideDown(500);
        $('#properties .next').click(function () {
            propertiesPage++;
            loadProperties(propertiesPage);
        });
        $('#properties .previous').click(function () {
            propertiesPage--;
            loadProperties(propertiesPage);
        });
    });
}

Here I leave the url to you check it and help me, please.

http://openhomeonline.com.au/reod/properties/black

Cheers

A: 

I guess the problem is you are binding lots of click events to .next and .previous every time the .load() calls its callback.

how about using .data() like this,

function loadProperties(propertiesPage) {
    $('#properties .content').slideUp(500);
    $('#properties .content').load('url' + propertiesPage, function () {
        $('.video a').colorbox({
            width: 800,
            height: '100%',
            iframe: true
        });
        $('#properties .content').slideDown(500);
        $('#properties').data('propertiesPage',propertiesPage);
    });
}

    $('#properties .next').click(function () {
        var propertiesPage = $('#properties').data('propertiesPage')++;
        $('#properties').data('propertiesPage',propertiesPage);
        loadProperties(propertiesPage);
    });
    $('#properties .previous').click(function () {
        var propertiesPage = $('#properties').data('propertiesPage')--;
        $('#properties').data('propertiesPage',propertiesPage);
        loadProperties(propertiesPage);
    });
Reigel