On 25.04.2011, 18:43 Tod wrote:
I've modified Mediawiki:Common.js to include the
following:
document.getElementById("p1").innerHTML="New text!";
I then created a page called testPage and inserted:
<p id="p1">Hello World!</p>
I'm expecting the text to change upon load but
nothing is happening.
Prior to the <p> tag addition I had an alert that was working as
expected so at least I know Common.js is working.
What is the best practice for adding custom javascript
code in
Mediawiki? While we're at it is there a real good tutorial on including
AJAX calls w/o needing an extension anywhere?
$( document ).ready( function() {
$( '#p1' ).html( 'New text by jQuery!' );
});
--
Best regards,
Max Semenik ([[User:MaxSem]])