How to convert a string value to a variable in javascript?

var test1; $(document).ready(function () { test1 = $("#test1ID").jQueryPlugin(); }); var test2; $(document).ready(function () { test2 = $("#test2ID").jQueryPlugin(); }); ... This is done so we could just do `test1.foo()`... foo is a function inside the jQueryPlugin that is accessible using `test1.foo()` syntax; So we have an array of strings which contains (test1, test2, ...) and we need to access foo() while on the loop: for(i=0; i

以上就是How to convert a string value to a variable in javascript?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏