This is undoubtedly entirely the wrong list to be posting to, but I imagine that there will be at least one or two people who know what's going on, or who have experienced a similar phenomenon.
Checking for cross-skin compatibility on a script which utilises MediaWiki's AJAX functions in ajax.js, I was surprised to see that the scripts were throwing errors due to the functions not being defined, despite the fact that ajax.js was definitely being run. Turns out that in Monobook, the user script (User:<x>/monobook.js) is the very last element of the document head, whereas in other skins it is called *before* the newer "sexier" MediaWiki JS scripts (ajax.js, ajaxwatch.js, mwsuggest.js, centralnotice.js), not allowing use of the functionality of those scripts without a contrived workaround.
I apologise if I've made that incredibly unclear, but here's how it looks: an excerpt from the source of a page viewed in Classic rather than Monobook.
<script type="text/javascript" src="/skins-1.5/common/wikibits.js?182"></script> <script type="text/javascript" src="/w/index.php?title=-&action=raw&smaxage=0&gen=js&usesk in=standard"><!-- site js --></script> <script type="text/javascript" src="/w/index.php?title=User:Haza-w.debug/standard.js&action=raw&ct ype=text/javascript"></script> <script type="text/javascript" src="/skins-1.5/common/ajax.js?182"></script> <script type="text/javascript" src="/skins-1.5/common/ajaxwatch.js?182"></script> <script type="text/javascript" src="/skins-1.5/common/mwsuggest.js?182"></script>
Compare with Monobook, where the site and user JS scripts are only called right at the end of the document head:
<script type="text/javascript" src="/w/index.php?title=-&action=raw&smaxage=0&gen=js&usesk in=monobook"><!-- site js --></script> <script type="text/javascript" src="/w/index.php?title=User:Haza-w.debug/monobook.js&action=raw&ct ype=text/javascript"></script> </head>
Does anyone know why this occurs, and how I could go about getting the discontinuity addressed?
- H
Harry Willis wrote:
This is undoubtedly entirely the wrong list to be posting to, but I imagine that there will be at least one or two people who know what's going on, or who have experienced a similar phenomenon.
Checking for cross-skin compatibility on a script which utilises MediaWiki's AJAX functions in ajax.js, I was surprised to see that the scripts were throwing errors due to the functions not being defined, despite the fact that ajax.js was definitely being run. Turns out that in Monobook, the user script (User:<x>/monobook.js) is the very last element of the document head, whereas in other skins it is called *before* the newer "sexier" MediaWiki JS scripts (ajax.js, ajaxwatch.js, mwsuggest.js, centralnotice.js), not allowing use of the functionality of those scripts without a contrived workaround.
I apologise if I've made that incredibly unclear, but here's how it looks: an excerpt from the source of a page viewed in Classic rather than Monobook.
<script type="text/javascript" src="/skins-1.5/common/wikibits.js?182"></script>
<script type="text/javascript" src="/w/index.php?title=-&action=raw&smaxage=0&gen=js&usesk in=standard"><!-- site js --></script>
<script type="text/javascript" src="/w/index.php?title=User:Haza-w.debug/standard.js&action=raw&ct ype=text/javascript"></script> <script type="text/javascript"
src="/skins-1.5/common/ajax.js?182"></script>
<script type="text/javascript" src="/skins-1.5/common/ajaxwatch.js?182"></script>
<script type="text/javascript" src="/skins-1.5/common/mwsuggest.js?182"></script>
Compare with Monobook, where the site and user JS scripts are only called right at the end of the document head:
<script type="text/javascript" src="/w/index.php?title=-&action=raw&smaxage=0&gen=js&usesk in=monobook"><!-- site js --></script>
<script type="text/javascript" src="/w/index.php?title=User:Haza-w.debug/monobook.js&action=raw&ct ype=text/javascript"></script>
</head>
Does anyone know why this occurs, and how I could go about getting the discontinuity addressed?
Use bugzilla: http://bugzilla.wikimedia.org/
-- Tim Starling