我想在窗口加载时进行 ajax 调用并使用 div#links 中的 url
到目前为止,这是我想出的:
$(window).load(function() {
    baseUrl =  $("#links a").attr("href");
    $.ajax({
        url: baseUrl,
        type: "get",
        dataType: "",
        success: function(data) {
            // from here not important
HTML:
<div id="links"></div> 
链接是动态创建的:
$('<a href="' + text + lnk + '">' + text + lnk + '</a>')
    .appendTo($('#links'));
但是,这似乎不起作用。