Here are some JSLint results:

以下是一些JSLint结果:

 1  finaffJS.module('custom_ribbon_buttons', ['jQuery'], function ($) {
 2      var my = {};
 3  
 4      my.insertLightBoxCloseDialog = function () {
 5          var url = $('#finaff-insert-lightbox-image-url').val();
 6          if (url) {
 7              var buttonHtml = '<a class="finaff-lightbox-link" href="' + encodeURI(url) + '"><div class="FinAff_View_Image_Button_Sprites FinAff_View_Image_Button">&#160;</div></a>';
 8              SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, buttonHtml);
 9          } else {
10              $('#finaff-insert-lightbox-image-url-flash').text('Need a URL');
11          }
12      }
13  
14      my.insertLightBoxClicked = function () {
    =^
    lint warning: missing semicolon

Where is the supposed missing semicolon?

假设丢失的分号在哪里?

Or why is JSLint confused?

或者为什么JSLint会混淆?

1 个解决方案

#1


2

You miss semicolon in line 12:

你错过第12行的分号:

 4      my.insertLightBoxCloseDialog = function () {
 5          var url = $('#finaff-insert-lightbox-image-url').val();
 6          if (url) {
 7              var buttonHtml = '<a class="finaff-lightbox-link" href="' + encodeURI(url) + '"><div class="FinAff_View_Image_Button_Sprites FinAff_View_Image_Button">&#160;</div></a>';
 8              SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, buttonHtml);
 9          } else {
10              $('#finaff-insert-lightbox-image-url-flash').text('Need a URL');
11          }
12      };

Take a look at the line 2, you are declaring a variable with a {}, and you put a semicolon. insertLightBoxCloseDialog also needs it, is the same.

看一下第2行,你用{}声明一个变量,然后你加一个分号。 insertLightBoxCloseDialog也需要它,是一样的。

更多相关文章

  1. jquery done()不能获取外部变量
  2. 使用window.open将变量传递给新的HTML
  3. 如果操作已发生,则增加变量
  4. 如何将标记中的值传递给PHP变量?
  5. 你能得到一个调用类的变量吗?
  6. Laravel 5 PDO绑定变量数与令牌数不匹配
  7. 是否可以在ajax中使用动态变量?
  8. 在Codeigniter中将javascript变量从视图发送到控制器[重复]
  9. 将Ajax div内容存储在PHP变量中

随机推荐

  1. 分享html元素调用服务器实例
  2. C#基础之操作优化实例教程
  3. 什么是链表?链表与数组的区别?
  4. 详解一篇搭建快速开发平台的实例步骤
  5. C#中在构造函数中访问虚成员有什么问题?
  6. Unity C# GetSaveFileName()的实例详解
  7. 什么是AspectCore Project ?
  8. 详解.net正则表达式怎么使用?
  9. 使用 VSCode 编写 .NET Core 项目的实例
  10. 实现GridView自动滚动的功能