当我点击两次时如何解决这个看似非法的问题?

时间:2017-02-13 23:47:13

标签: javascript jquery

我有这个功能,当我第一次点击但是当我第二次点击这个部分时收到错误

eval("var " + data + "=sinvnword;");

代码:

$('a.play-video').click(function(){
  var currentLocation = window.location;


  var fullurl = window.location.href; 
  url =  fullurl.split("sendx")[1];

  var sinvnword = $('.question-label.active').last().text();

  console.log(sinvnword);
  var data =url ;
  eval("var " + data + "=sinvnword;");

  console.log(AXY + "GETIT");
  console.log(AXY+"mor");

  console.log(AXY + "muerte"); 
});

1 个答案:

答案 0 :(得分:0)

不是使用SELECT o.order_id , o.server , o.subtotal , o.discount , o.tax, o.total , (SELECT (o.total - SUM(p.total_collected)) from orders o join payments p on o.order_id = p.order_id group by p.order_id) as 'Due' FROM orders o join payments p on o.order_id = p.order_id WHERE...; 创建动态变量名称,只需使用动态属性名称

eval