မီဒီယာဝီကီ ဆွေးနွေးချက်:Common.js

အခြားဘာသာစကားများဖြင့် စာမျက်နှာအကြောင်းအရာများကို ပံ့ပိုးမထားပါ။
ဝီကီပီးဒီးယား မှ

I'm getting the following error:

document.getElementById("Padauk") has no properties
 detectFont()
  runOnloadHook()

at

296 document.getElementById('Padauk').innerHTML = result[3]; 

Mike.lifeguard | @meta ၀၃:၁၆၊ ၁၇ စက်​တင်​ဘာ​ ၂၀၀၈ (UTC)

I think the issue is that you're not testing whether the element with that exists before trying to get the properties of that element. So try something like
function detectFont(){
    d = new Detector;
    result = d.test("Padauk");
	var p = document.getElementById("Padauk");
	if(p) p.innerHTML = result[3]
	result = d.test("Myanmar3");
	var p = document.getElementById("Myanmar3");
	if(p) p.innerHTML = result[3]
	result = d.test("Parabaik");
	var p = document.getElementById("Parabaik");
	if(p) p.innerHTML = result[3]
	result = d.test("MyMyanmar Unicode");
	var p = document.getElementById("MyMyanmar");
	if(p) p.innerHTML = result[3]
	result = d.test("Myanmar2");
	var p = document.getElementById("Myanmar2");
	if(p) p.innerHTML = result[3]
}
Mike.lifeguard | @meta ၂၁:၃၂၊ ၁၉ ဖေ​ဖော်​ဝါ​ရီ​ ၂၀၀၉ (UTC)
Thanks a lot, I added the changes You proposed, since no one was able to fix it since 17 September 2008, when You reported the problem first, and it just works great, kind thanks, --ငှက် (:> )=| ၂၁:၃၇၊ ၁၉ ဖေ​ဖော်​ဝါ​ရီ​ ၂၀၀၉ (UTC)

Give search results even when page doesn't exist[ပြင်ဆင်ရန်]

Screenshot of the Earth test search, with this script adding links to Wikidata, Reasonator, Commons, and Wikipedia.

Hello, I propose to enable the tool created by Magnus Manske (creator of MediaWiki) to provide results from other languages and Commons (via Wikidata) when a page doesn't exist here: links are added to Special:Search and noarticletext. This helps to encourage translation and to make readers use your wiki more, because they can be sure to find something even if it's not local (rather than searching directly on the biggest wiki). The Italian and Polish Wikipedias, among others already enabled it by default.
Examples: [၁] [၂] [၃]. More information: Magnus blog.
How to: just add the following line at the end of Common.js.

// Results from Wikidata
// 
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
	importScriptURI("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
}
--Nemo  ၀၁:၀၀၊ ၅ ဧပြီ ၂၀၂၃ (UTC) (comments, translations and last instructions)[အကြောင်းပြန်ရန်]