User:NewsAndEventsGuy/common.js: Difference between revisions
Appearance
Content deleted Content added
Annotate, Disable importscript, and copy contents of test.js Expect this to reproduce the show button problem on the "same paragraph" test page |
replace first linke (mw.hook....) with original jQuery(document).ready(function($) |
||
Line 8: | Line 8: | ||
// [[User:NewsAndEventsGuy/ShowButtonTest-SameParagraph]] |
// [[User:NewsAndEventsGuy/ShowButtonTest-SameParagraph]] |
||
jQuery(document).ready(function($) { |
|||
var href, |
var href, |
||
links = $content.find( 'a[href^="#CITEREF"]' ); |
links = $content.find( 'a[href^="#CITEREF"]' ); |
Revision as of 20:23, 12 August 2019
//In my last test, there was no problem. In the last test the entire
//contents of this file were
// importscript('|User:NewsAndEventsGuy/test.js');
//and test.js consisted of the javascript code below, which I have copied here
//in its entirety. I expect the show button on the "same paragraph" test
//page to be disabled for reasons unknown. The test pages are
// [[User:NewsAndEventsGuy/ShowButtonTest-DifferentParagraphs]]
// [[User:NewsAndEventsGuy/ShowButtonTest-SameParagraph]]
jQuery(document).ready(function($) {
var href,
links = $content.find( 'a[href^="#CITEREF"]' );
links.each( function (i, elem) {
href = elem.getAttribute( 'href' ).substring(1); //skip the #
if ( 1 < 3) {
elem.parentNode.innerHTML += "harv error";}
} );
});
// Save this comment in case it sheds light
// IDs can contain characters like . that have meaning in selectors
// use $.escapeSelector to make sure they are escaped