当前位置: 首页 > news >正文

Uncaught SyntaxError: ‘‘ string literal contains an unescaped line break

今天在修改前端页面的时候,页面报错了,提示了这个信息

Uncaught SyntaxError: '' string literal contains an unescaped line break

 问题指向这行代码,这就是通过JS渲染一个easyui的搜索框,仔细确认之后,发现没有任何问题

$(document).ready(function() {$("#searchbar").searchbox({prompt: "请输入称谓名称",width: 200,menu: "#menu",searcher: function(value, name) {$("#chengwei_list").datagrid("load", {permanent: name,name: value});}});});

那么,问题很有可能就出在页面上了,查看页面的代码,发现是复制的时候漏掉了个单引号

<!DOCTYPE html>
<html><head><meta charset="utf-8" /><link rel="stylesheet" href="/css/themes/icon.css"/><link rel="stylesheet" href="/css/themes/default/easyui.css" /><link rel="stylesheet" href="/css/public.css"/><title>角色账号管理>>称谓列表</title><script src="/js/public/jquery.min.js"></script><script src="/js/easyui/jquery.easyui.min.js"></script><script src="/js/easyui/easyui-lang-zh_CN.js"></script><script src="/js/public/util.js"></script><script src="/js/public/public.js"></script><script src="/js/achievement/chengwei_list.js"></script></head><body><form id="search_form"><table><tr><td><input id="searchbar" /></td></tr></table></form><div id="menu" style="width:120px;"><div data-options="name:'0',iconCls:'icon-ok'">限时称谓</div><div data-options="name:'1',iconCls:'icon-ok">永久称谓</div></div></body>
</html>

就在这里

<div id="menu" style="width:120px;">
        <div data-options="name:'0',iconCls:'icon-ok'">限时称谓</div>
        <div data-options="name:'1',iconCls:'icon-ok">永久称谓</div>//这行的icon-ok后面少了个单引号
</div>

添加单引号之后页面恢复正常

好了,这篇文章就分享到这里了,如果文章内容对你有所帮助,不要忘了点赞+收藏哦~

http://www.lryc.cn/news/103987.html

相关文章:

  • Vue3+Vite+TypeScript常用项目模块详解
  • 数字电路(一)
  • Oracle也有回收站
  • 投稿注意!APA格式超全示例详解,原本28天能录用,可能要拖延2个月
  • 【Python】Web学习笔记_flask(1)——模拟登录
  • css单行文本省略号多行文本省略号
  • 信号槽中的函数重载
  • 计算机视觉(五)深度学习基础
  • ES6学习-Generator
  • Flowable-服务-微服务任务
  • opencv03-补充-vector的操作
  • 二叉树(C语言)
  • 介绍下Django中的表单(forms)模块中的类forms.CharField
  • 元宇宙与数字孪生的异同?
  • 智慧农业:科技赋能农村发展
  • x86架构ubuntu22下运行WILL模拟器dophin
  • Jvm的一些技巧
  • 8.docker仓库
  • 价值 1k 嵌入式面试题-计算机网络 OSI
  • spring boot去除get post空格
  • 设计模式四:单例模式(Singleton)
  • 《水经注地图服务》发布的影像数据如何在OsgEarth中调用
  • css滤镜:drop-shadow
  • java ThreadLocal
  • MySQL高级篇第6章(索引的数据结构)
  • Unity 性能优化三:动画模块、物理模块
  • 延迟函数
  • IBM报告:2023数据泄露平均成本将达到445万美元
  • 20.3 HTML 表格
  • flutter项目运行时一直卡在Running Gradle task ‘assembleDebug‘解决办法