No, as far I as can see.

I wrap some lists of words with <strong> using a little fn:

        function setBold(text) {
                var occur = text.split(",");
                for( i=0; i<occur.length; i++ ){
                        var TEXT = occur[i].toUpperCase();
                        $('p').each(function() {
                                $.highlight(this, TEXT);
                        });
                }
        }

which calls jQuery.highlight from Johann Burkard:

$(function () {
    jQuery.highlight = document.body.createTextRange ?
    function (node, te) {
        var r = document.body.createTextRange();
        r.moveToElementText(node);
        for (var i = 0; r.findText(te); i++) {
            r.pasteHTML('<strong>' + r.text + '<\/strong>');
            r.collapse(false)
        }
    }: function (node, te) {
        var pos, skip, spannode, middlebit, endbit, middleclone;
        skip = 0;
        if (node.nodeType == 3) {
            pos = node.data.toUpperCase().indexOf(te);
            if (pos >= 0) {
                spannode = document.createElement('strong');
                spannode.className = 'highlight';
                middlebit = node.splitText(pos);
                endbit = middlebit.splitText(te.length);
                middleclone = middlebit.cloneNode(true);
                spannode.appendChild(middleclone);
                middlebit.parentNode.replaceChild(spannode,
middlebit);
                skip = 1
            }
        } else if (node.nodeType == 1 && node.childNodes && !/(script|
style)/i.test(node.tagName)) {
            for (var i = 0; i < node.childNodes.length; ++i) {
                i += $.highlight(node.childNodes[i], te)
            }
        }
        return skip
    }
});

Then I look for some of these ".highlight", and this is when Firefox
find it and IE doesn't.



On Jul 14, 12:57 am, Ricardo <ricardob...@gmail.com> wrote:
> What is the other script that adds the class, does it involve ajax/get/
> load?
>

Reply via email to