this is my code, I can't it working:

function versechooser(verso,version)
{
    miversion= (version == null)? "RVR1960": version;
    $resultado = null;
    url = "http://query.yahooapis.com/v1/public/yql?"; + "q=select%20*
%20from%20html%20where%20url%3D%22"+
    encodeURIComponent("http://www.biblegateway.com/passage/?search=";
+ verso +
        "&version=" + miversion) + "%22&format=xml'&callback=?";

    (function(){
        $.getJSON(url,function(data){
            if(data.results[0])
            {
                $resultado = $(data.results[0]).find("div.result-text-
style-normal:first, .multipassage-box").find("strong, p:not(:contains
('Copyright'))");
                $resultado.find("h4, h5, div, a, sup, br").remove();
            }
            else
            {
                $resultado = $("<p>Pasaje no encontrado.</p>");
            }
        });
    })();
    alert("done");
    return $resultado;
}

 $(document).ready(function(){
            $("#verso").html(versechooser("juan 3:16", "RVR1960"));
        });

Reply via email to