我要完成的工作是使用javascript在该部分中编写一个元素。我要添加的链接元素看起来像这样
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Oswald&effect=neon">
根据要求,我已经发布了完整的代码:
<!doctype html>
<html>
<head>
<title>Extra-Life Alerts</title>
<meta charset="utf-8">
<link href="singleAlert.css" rel="stylesheet">
<script>
var effect = $.url().param('effect');
var font = $.url().param('font');
/*
//document.getElementById("body").innerHTML = document.write('<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=' + font + '&effect=' + effect +'">');
//document.getElementById('head').innerHTML += '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family="' + font + '"&effect="' + effect + '"">';
//var stylesheetAdd = '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family="' + font + '"&effect="' + effect + '"">';
$(function() {
$('head').append('<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family="' + font + '"&effect="' + …Run Code Online (Sandbox Code Playgroud)