微件:PlantInfo:修订间差异
跳转到导航
跳转到搜索
无编辑摘要
无编辑摘要 |
无编辑摘要 |
||
第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' ), | |||
data: { | |||
action: 'parse', | |||
text: '<tabber>1技能=<img src="' + pic1 + '"/>|-|2技能=<img src="' + pic2 + '"/></tabber>', | |||
contentmodel: 'wikitext', | |||
format: 'json' | |||
}, | |||
dataType: 'json', | |||
type: 'POST', | |||
success: function( data ) { | |||
if ( data && data.parse && data.parse.text ) { | |||
var html = data.parse.text['*']; | |||
// Insert the HTML into the tabber container | |||
$( '#tabberContainer' ).html( html ); | |||
} | |||
}, | |||
error: function( xhr ) { | |||
// Handle errors | |||
console.error(xhr); | |||
} | } | ||
} | } ); | ||
}); | |||
} ); | |||
</script> | </script> | ||
<!--{/if}--> | <!--{/if}--> | ||
</includeonly> | </includeonly> |