微件:PlantInfo:修订间差异

来自PlantsVsZombies Mixed
跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
第30行: 第30行:
<!--{if $pic2}-->
<!--{if $pic2}-->
<script type="text/javascript">
<script type="text/javascript">
var pic1 = "<!--{$pic|escape:'javascript'}-->";
$(document).ready(function() {
var pic2 = "<!--{$pic2|escape:'javascript'}-->";
    var pic1 = "<!--{$pic|escape:'javascript'}-->";
    var pic2 = "<!--{$pic2|escape:'javascript'}-->";


$.ajax( {
    $.ajax( {
    url: mw.util.wikiScript( 'api' ),
        url: mw.util.wikiScript( 'api' ),
    data: {
        data: {
        action: 'parse',
            action: 'parse',
        text: '<tabber>1技能=<img src="' + pic1 + '"/>|-|2技能=<img src="' + pic2 + '"/></tabber>',
            text: '<tabber>1技能=<img src="' + pic1 + '"/>|-|2技能=<img src="' + pic2 + '"/></tabber>',
        contentmodel: 'wikitext',
            contentmodel: 'wikitext',
        format: 'json'
            format: 'json'
    },
        },
    dataType: 'json',
        dataType: 'json',
    type: 'POST',
        type: 'POST',
    success: function( data ) {
        success: function( data ) {
        if ( data && data.parse && data.parse.text ) {
            if ( data && data.parse && data.parse.text ) {
            var html = data.parse.text['*'];
                var html = data.parse.text['*'];
            // Insert the HTML into the tabber container
                // Insert the HTML into the tabber container
            $( '#tabberContainer' ).html( html );
                $( '#tabberContainer' ).html( html );
            }
        },
        error: function( xhr ) {
            // Handle errors
            console.error(xhr);
         }
         }
     },
     } );
    error: function( xhr ) {
});
        // Handle errors
    }
} );
</script>
</script>
<!--{/if}-->
<!--{/if}-->
</includeonly>
</includeonly>

2024年2月14日 (三) 22:50的版本