我试图在组件中使用vue.js进行recaptcha回调.验证码本身确实有效,但不是我在data-callback属性中定义的回调.
我已经尝试了我能想到的一切,但我仍然得到ReCAPTCHA couldn't find user-provided function: dothisthat错误.
这是组件
<script>
function dothisthat (){
alert(312);
}
</script>
<template>
<div class="well main-well">
<h4>Captcha</h4>
<p class="small">You must complete the captcha to finish your booking.</p>
<div id="captcha-wrapper">
<div class="g-recaptcha" :data-sitekey="captchaKey" data-callback="dothisthat"></div>
</div>
</div>
</template>
<script>
function dothisthat (){
alert(123);
}
import * as filters from '../../../filters';
import Translation from '../../../Translation';
export default {
name: 'Captcha',
props: {
},
computed: {
captchaKey: function() {
return this.$store.getters.captcha;
}
},
methods: {
dothisthat: function(){ …Run Code Online (Sandbox Code Playgroud) 我希望在某些情况下显示某个 div,并且我希望它具有动画效果,一开始它应该是不可见的,所以...
.fixedNav{
background-color: rgba(28,20,13, 0.75);
position:fixed;
color:white;
width:60vw;
margin-top:-50px !important;
z-index: 1;
display:none;
opacity:0;
transition:opacity .3s ease-in;
}
Run Code Online (Sandbox Code Playgroud)
然后我通过使用 jquery 添加这个类来使用 css 为不透明度设置动画:
.fixedNavActive{
display: block;
opacity:1;
}
Run Code Online (Sandbox Code Playgroud)
如果我删除显示,一切正常:无;从主类开始,如果我将它留在那里,那么不透明度不会被动画化,它只是出现,为什么它会破坏它,我怎样才能让它动画化不透明度而不是将其切换为 1?
我有一个jquery函数,从php文件中检索数据,并将所有这些放入选择列表,这很好,问题是它需要一些时间来加载,我想在选择加载时显示加载文本,但它似乎不起作用,这是我尝试过的:
var modelSelect = $('[name="model"]'); // this is the select <select> list
$('[name="make"]').on('change', function(){ // another <select> that fires up the ajax
var chosen = $(this).val();
$.ajax({
type: "POST",
url: "process.php",
data: {'send': chosen},
beforeSend: function(){
modelSelect.html("loading"); //doesn't work
},
success: function(data){
modelSelect.html(data);
}
});
});
Run Code Online (Sandbox Code Playgroud)
任何想法我怎么能说它在那里装?
晚上好,
我需要从文件中读取一些行,该文件是 csv,文件的结构如下:
4,
Mo Farah,30,
Jessica Ennis,27,
Run Code Online (Sandbox Code Playgroud)
我需要读取这些值并将它们放入变量中,这就是我尝试执行此操作的方式:
while(nextline != null){
StringTokenizer st = new StringTokenizer(nextline,",");
int size = Integer.parseInt(st.nextToken());
System.out.println(size);
nextline = reader.readLine();
StringTokenizer st2 = new StringTokenizer(nextline, ","); //why???
String name = st2.nextToken();
System.out.println(name);
int age = Integer.parseInt(st2.nextToken());
System.out.println(age);
Run Code Online (Sandbox Code Playgroud)
第一个 int (4) 读取得很好,但是如果我想移动到下一行,它会抛出 noSuchElementException,所以我必须在“//why???”旁边写下这一行 为了移至下一行,每次我想移至下一行时,我真的必须实例化一个新的分词器吗?或者有更好的方法吗?
非常感谢