首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >PUG意外文本

PUG意外文本
EN

Stack Overflow用户
提问于 2018-07-08 17:14:57
回答 0查看 2.9K关注 0票数 0

我不得不将一个jade文件转换成pug格式。我设法纠正了一些错误,但我阻止了这一点:

代码语言:javascript
运行
复制
> Error: C:\Users\Asus\Desktop\cours_nodejs\views\expressO1.pug:19:20
>     17|             $.get('/hello/', + $('[name=name]:checked').val(),
>     18| function(data) {
>   > 19|                    $('#message').html(data.message);
> ---------------------------^
>     20|                }, 'json' );
>     21|           }
> 
> unexpected text "$('#m"
>     at makeError (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-error\index.js:32:13)
>     at Lexer.error (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-lexer\index.js:59:15)
>     at Lexer.fail (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-lexer\index.js:1441:10)
>     at Lexer.advance (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-lexer\index.js:1501:15)
>     at Lexer.callLexerFunction (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-lexer\index.js:1456:23)
>     at Lexer.getTokens (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-lexer\index.js:1512:12)
>     at lex (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-lexer\index.js:12:42)
>     at Object.lex (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug\lib\index.js:99:27)
>     at Function.loadString [as string] (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug-load\index.js:44:24)
>     at compileBody (C:\Users\Asus\Desktop\cours_nodejs\node_modules\pug\lib\index.js:86:18)

尽管我进行了研究,但我无法理解是什么导致了这个错误(也没有找到解决它的解决方案)。以下是pug文件的代码:

代码语言:javascript
运行
复制
doctype html
head
 title=theTitle
 body
   div Choisir unprenom :
   - for name intheNames
     label
      input(type="radio", name="name", value=name)
      spanPrenom : #{name}
     br
   div
      input(type="button", onclick="valid()",value="OK")
      #message
      script(src="http://code.jquery.com/jquery-1.10.1.min.js")
      script.
         function.valid() { 
            $.get('/hello/', + $('[name=name]:checked').val(),
function(data) {
                   $('#message').html(data.message);
               }, 'json' );
          }

谢谢你的建议!

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51230496

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档