mozilla
Your Search Results

    Template:expTrevorh

    <%
    /*
     * Get page content from a MediaWiki site
     *
     * $0 - The domain and base path. The bit before /api.php
     * $1 - Page title
     *
     * https://www.mediawiki.org/wiki/API:Main_page
     */
    var mdn = require("MDN:Common");
    
    var output = "";
    
    var domain = encodeURI($0);
    var title = encodeURI($1);
    var url = domain + '/api.php?format=json&action=query&titles=' + title + '&prop=revisions&rvprop=content&rvparse=1&indexpageids';
    
    var reply = mdn.fetchJSONResource(url);
    
    if (reply != null) {
        var pageid = reply.query.pageids[0];
        if (pageid) {
            output = reply.query.pages[pageid].revisions[0]["*"];
        }
    }
    %>
    <%- output %>
    Search for pages that use Template:expTrevorh to see example use cases and how many pages use this macro.

    Document Tags and Contributors

    Contributors to this page: openjck, trevorh
    Last updated by: trevorh,