下面的人是我的剧本,但任何人都不知道为什么??? 想检查一下吗?请使用此脚本: - http://calcus.host56.com/make_your_own_link.htm
<html><head>
<title>Hello</title>
<style>
a {color:black;font-size:23;}
textarea {color:white;font-size:1;border:none;}
</style>
<script>
function select8()
{
document.getElementById("demo").select();
}
</script>
</head>
<body>
<script>
function myFunction()
{
var x;
var name=prompt("Please enter your Facebook username","");
if (name!=null)
{
x="https://www.facebook.com/dialog/apprequests?api_key=148768088503846&app_id=148768088503846&data=%7B%7B"+"category"+"%3A"+"virtue"+"%7D%7D&display=popup&filters"+"&frictionless=false&locale=en_US&message=Here+is+a+Virtue+for+you+Mihir+Gupta%21%21+By+Chirag+Jain&next=http%3A%2F%2Fvolcanoisland.brokenbulbstudios.com%2F%252Ff312818684%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df18dc1ab6%26result%3D%2522xxRESULTTOKENxx%2522"+"&sdk=joey&title=Send+your+friends+a+daily+gift&to="+name;document.getElementById("demo").innerHTML=x;
}
}
</script>
<button onclick="myFunction()" accesskey="v">Click Here to Make Your Own Virtue Link </button>
<br>
<textarea id="demo">Your Url Here</textarea>
<button onclick="select8()" accesskey="x">Entered username?? <br>Now Click here and press Ctrl + c to copy the link </button>
答案 0 :(得分:0)
试试this jsfiddle。您必须在myFunction()
部分定义head
。
<html>
<head>
<title>Hello</title>
<style>
a {color:black;font-size:23;}
textarea {color:white;font-size:1;border:none;}
</style>
<script>
function myFunction()
{
var x;
var name=prompt("Please enter your Facebook username","");
if (name!=null)
{
x="https://www.facebook.com/dialog/apprequests?api_key=148768088503846&app_id=148768088503846&data=%7B%7B"+"category"+"%3A"+"virtue"+"%7D%7D&display=popup&filters"+"&frictionless=false&locale=en_US&message=Here+is+a+Virtue+for+you+Mihir+Gupta%21%21+By+Chirag+Jain&next=http%3A%2F%2Fvolcanoisland.brokenbulbstudios.com%2F%252Ff312818684%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df18dc1ab6%26result%3D%2522xxRESULTTOKENxx%2522"+"&sdk=joey&title=Send+your+friends+a+daily+gift&to="+name;document.getElementById("demo").innerHTML=x;
}
}
function select8()
{
document.getElementById("demo").select();
}
</script>
</head>
<body>
<button onclick="myFunction()" accesskey="v">Click Here to Make Your Own Virtue Link </button>
<br>
<textarea id="demo">Your Url Here</textarea>
<button onclick="select8()" accesskey="x"> Entered username?? <br />Now Click here and press Ctrl + c to copy the link </button>
</body>
</html>