Replacing a repeating code block with a common function.

Adding the MDN root URL to a variable and concatenating it with the individual page paths as required instead of repeating the full URL everywhre.