MediaWiki:Common.js: Difference between revisions
Startupedia (talk | contribs) Added schema code |
Startupedia (talk | contribs) Added link opening in new tab |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
$(function () { | |||
{ | const structuredData = { | ||
"@context": "https://schema.org", | |||
"@type": "WebSite", | |||
"name": "Startupedia", | |||
"url": "https://startupwiki.ai", | |||
"potentialAction": { | |||
"@type": "SearchAction", | |||
"target": "https://startupwiki.ai/index.php?search={search_term_string}", | |||
"query-input": "required name=search_term_string" | |||
} | } | ||
}; | |||
const script = document.createElement('script'); | |||
script.type = 'application/ld+json'; | |||
script.text = JSON.stringify(structuredData); | |||
document.head.appendChild(script); | |||
}); | |||
$(function () { | |||
$('a.external').attr('target', '_blank'); | |||
}); |
Revision as of 16:22, 31 May 2025
/* Any JavaScript here will be loaded for all users on every page load. */ $(function () { const structuredData = { "@context": "https://schema.org", "@type": "WebSite", "name": "Startupedia", "url": "https://startupwiki.ai", "potentialAction": { "@type": "SearchAction", "target": "https://startupwiki.ai/index.php?search={search_term_string}", "query-input": "required name=search_term_string" } }; const script = document.createElement('script'); script.type = 'application/ld+json'; script.text = JSON.stringify(structuredData); document.head.appendChild(script); }); $(function () { $('a.external').attr('target', '_blank'); });