Javascript 对话框脚本不工作
下面的人是我的脚本,但它不起作用。有人能告诉我为什么吗?Javascript 对话框脚本不工作,javascript,dialog,Javascript,Dialog,下面的人是我的脚本,但它不起作用。有人能告诉我为什么吗? 想查查吗?请在以下位置使用此脚本:- 你好 a{颜色:黑色;字体大小:23;} text区域{颜色:白色;字体大小:1;边框:无;} 函数select8() { document.getElementById(“demo”).select(); } 函数myFunction() { var x; var name=prompt(“请输入您的Facebook用户名”); if(name!=null) { x=”https://www.fa
想查查吗?请在以下位置使用此脚本:-
你好
a{颜色:黑色;字体大小:23;}
text区域{颜色:白色;字体大小:1;边框:无;}
函数select8()
{
document.getElementById(“demo”).select();
}
函数myFunction()
{
var x;
var name=prompt(“请输入您的Facebook用户名”);
if(name!=null)
{
x=”https://www.facebook.com/dialog/apprequests?api_key=148768088503846&app_id=148768088503846&data=%7B%7B“+”类别“+%3A”+”优点“+%7D%7D&display=弹出窗口和过滤器”+“&frictionless=false&locale=en_US&message=Here+is+a+美德+for+you+Mihir+Gupta%21%21+By+Chirag+Jain&next=http%3A%2F%2F火山岛.brokenbulbstudios.com%2F%252Ff312818684%26关系%3opener%26传输%3Dpostmessage%26帧%3Df18dc1ab6%26结果%3D%2522xxresultokenxx%2522”+&sdk=joey&title=Send+your+friends+daily+tokenxx%2522”=“+name;document.getElementById(“demo”).innerHTML=x;
}
}
单击此处创建您自己的美德链接
你的网址在这里
输入用户名
现在单击此处并按Ctrl+c复制链接
试试看。您必须在head
部分中定义myFunction()
<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>
你好
a{颜色:黑色;字体大小:23;}
text区域{颜色:白色;字体大小:1;边框:无;}
函数myFunction()
{
var x;
var name=prompt(“请输入您的Facebook用户名”);
if(name!=null)
{
x=”https://www.facebook.com/dialog/apprequests?api_key=148768088503846&app_id=148768088503846&data=%7B%7B“+”类别“+%3A”+”优点“+%7D%7D&display=弹出窗口和过滤器”+“&frictionless=false&locale=en_US&message=Here+is+a+美德+for+you+Mihir+Gupta%21%21+By+Chirag+Jain&next=http%3A%2F%2F火山岛.brokenbulbstudios.com%2F%252Ff312818684%26关系%3opener%26传输%3Dpostmessage%26帧%3Df18dc1ab6%26结果%3D%2522xxresultokenxx%2522”+&sdk=joey&title=Send+your+friends+daily+tokenxx%2522”=“+name;document.getElementById(“demo”).innerHTML=x;
}
}
函数select8()
{
document.getElementById(“demo”).select();
}
单击此处创建您自己的美德链接
你的网址在这里
输入用户名
现在单击此处并按Ctrl+c复制链接
您能解释一下什么不起作用以及它应该如何工作吗?
<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>