MediaWiki:Gadget-NamespaceNotice.js: Difference between revisions
Content deleted Content added
fixed code |
let's try this |
||
Line 1: | Line 1: | ||
/* Show a notice inside <div id="contentSub"></div> on pages in the Talk namespace */ |
/* Show a notice inside <div id="contentSub"></div> on pages in the Talk namespace */ |
||
if ( mw.config.get( 'wgNamespaceNumber' ) == 1 ) { |
if ( mw.config.get( 'wgNamespaceNumber' ) == 1 ) { |
||
var text = $.getJSON( |
|||
⚫ | |||
wgScriptPath + '/api.php?', |
|||
{ |
|||
action: 'parse', |
|||
prop: 'text', |
|||
page: 'Template:Contribute', |
|||
format: 'json' |
|||
}, |
|||
function( data ) { |
|||
if ( data ) { |
|||
var text = data.parse.text['*']; |
|||
⚫ | |||
} |
|||
} |
|||
) |
|||
} |
} |
Revision as of 02:36, 30 April 2012
/* Show a notice inside <div id="contentSub"></div> on pages in the Talk namespace */
if ( mw.config.get( 'wgNamespaceNumber' ) == 1 ) {
var text = $.getJSON(
wgScriptPath + '/api.php?',
{
action: 'parse',
prop: 'text',
page: 'Template:Contribute',
format: 'json'
},
function( data ) {
if ( data ) {
var text = data.parse.text['*'];
$('#contentSub').html(text);
}
}
)
}