tags:

views:

41

answers:

1

Hi,

As the title states, Jquery is turning my text white in certain areas of the page. it cant be the im using to encapsulate the ajax call, because it works fine when im not calling the ajax

Its a bit difficult to post the whole script, because its huge and i dont know where its happening. I have no idea how to debug this using firebug, because i dont know where the problem occurs.

Any help is much appreciated

here is the script i am using:

<script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>

    <script type="text/javascript" src="js/jquery.history.js"></script>

    <script type="text/javascript">

    $(document).ready(function () {


        $.history.init(pageload);   

        $('a[href=' + window.location.hash + ']').addClass('selected');

        $('a[rel=ajax]').click(function () {

            var hash = this.href;
            hash = hash.replace(/^.*#/, '');
            $.history.load(hash);   

            $('a[rel=ajax]').removeClass('selected');
            $(this).addClass('selected');
            $('#body').hide();
            $('.loading').show();

            getPage();

            return false;
        }); 
    });

    function pageload(hash) {
        if (hash) getPage();    
    }

    function getPage() {

hash = document.location.hash;
hash = hash.replace(/^.*#/, '');
        var data = 'page=' + encodeURIComponent(hash);
        $.ajax({
            url: "index.php",   
            type: "POST",       
            data: data,     
            cache: false,
            success: function (html) {  
                $('.loading').hide();               
                $('mytag').html(html);
                $('#body').fadeIn('slow');      

            }       
        });
    }

    </script>

cheers ke

A: 

You can use the Firefox Firebug extension for tracking CSS-Styles and even debugging JavaScript. It allows you to select elements directly from the page and see the CSS inheritance tree from that element, which should it make very easy for you to track down what's happening.

Bobby
yep, i am using firebug, but i cannot find where the problem is happening, its v weird, some text in a div above is appearing just fine, but underneath it turns white for some reason...
Ke