Hello folks,

Another simple question I'm sure. I have a preview page in which I want to display the text of a tags, but to disable the tag by changing its href contents to #.

The code I use to populate the div (#preview) after an ajax call is....

function showResponse(json) {
    if (json.fields) {
        for (var i = 0; i < json.fields.length; i++) {
            var field = json.fields[i];
            $("#theIndicator").hide();
            switch(field.yesno) {
            case "Y":
                $("div#preview").html(field.preview);
                $("div#preview a").href('#');
                
$("div#content_editor").highlightFade({color:'yellow',speed:2000,iterator:'sinusoidal'});
                $("#sMoreLinks, #sMoreLinksText, #sMoreLinksDesc").val('');
                $('#sMoreLinksAction').val("add")
                $("#sMoreLinksDiv").html(field.linktable);
                break;
            case "N":
                
$("div#content_editor").highlightFade({color:'red',speed:2000,iterator:'sinusoidal'});
                $('#links_fback').html(field.message).addClass("error").show();
            }
        }
    }
}

My attempt ($("div#preview a").href('#');) does not work - I don't understand why it doesn't. Any suggestions/insights?

Thanks,

Bruce 
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to