Wars+

Tools for Hacker Wars

< 腳本Wars+的回應

評論:普通 - 腳本能使用,但有一些問題

§
發表於:2025-03-05

Nice, thanks a lot! Though I had an issue with the log database tabs to switch between local and web logs not working. I threw the code in chat gpt (o3-mini) and explained the problem and it gave me a fix.

$('#tablocal').click(function(){ … });
$('#tabweb').click(function(){ … });

"It looks like your script re-creates the tab HTML (via modLogDBPage and setupLogDbPage) which can sometimes wipe out previously bound click events. One likely reason the Local Logs and Internet Logs tabs aren’t switching is that after you call setupLogDbPage to inject new HTML into the content area, the original tab elements (or their event bindings) may have been replaced or lost."

$(document).on('click', '#tablocal', function(){
    $('#tablocal').attr('class','link active');
    $('#tabweb').attr('class','link');
    setupLogDbPage('local', 'Local');
    loadLocalLogs();
});
$(document).on('click', '#tabweb', function(){
    $('#tabweb').attr('class','link active');
    $('#tablocal').attr('class','link');
    setupLogDbPage('web', 'Internet');
    loadWebLogs();
});

this change got it working :)

發表回覆

登入以回覆

长期地址
遇到问题?请前往 GitHub 提 Issues。