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

网站的链接结构包括常用的关键词挖掘工具

网站的链接结构包括,常用的关键词挖掘工具,网站设计深圳网站建设公司,临沂网站JSON在线压缩功能&#xff0c;适配所有框架&#xff0c;轻量便捷。支持压缩、格式化、校验功能&#xff0c;并且能标记错误位置&#xff0c;话不多说&#xff0c;上架。。。 <!DOCTYPE html> <html lang"en"> <head> <meta charset"UTF-8&…

        JSON在线压缩功能,适配所有框架,轻量便捷。支持压缩、格式化、校验功能,并且能标记错误位置,话不多说,上架。。。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Editor</title>
<style>body {font-family: Arial, sans-serif;margin: 20px;}.json_edit{width: 100%;}.json_edit .text_contant {width: 100%;height: 300px;border: 1px solid #ccc;padding: 10px;font-size: 14px;outline: none;font-family: monospace;}.json_edit .optionBtn {padding: 10px 15px;margin: 5px;background-color: #007bff;color: #fff;border: none;cursor: pointer;font-size: 14px;}.json_edit #toolTop {margin-top: 20px;padding: 10px;background: #f9f9f9;white-space: pre-wrap;color: #ff4343;}.json_edit .optionBtn:hover {background-color: #0056b3;}.json_edit .error {border: 2px solid #ff4343;background-color: #ffe6e6;}.json_edit .error_content {background-color: #ffcccc;color: #ff4343;font-weight: bold;}.json_edit .line_number {display: inline-block;width: 30px;text-align: right;margin-right: 10px;color: #888;font-size: 13px}</style>
</head>
<body><div class="json_edit"><textarea class="text_contant" id="textareaInput" oninput="clearError()"></textarea><button class="optionBtn" onclick="formatJSON()">格式化JSON</button><button class="optionBtn" onclick="compressJson()">压缩JSON</button><div id="toolTop"></div></div><script>const validJSON = (str) => {try {const obj = JSON.parse(str);return typeof obj === 'object' && obj !== null && (Array.isArray(obj) || Object.prototype.toString.call(obj) === '[object Object]');} catch (e) {return false;}}// 格式化json操作const formatJSON = ()=> {const textareaInput = document.getElementById('textareaInput');const toolTop = document.getElementById('toolTop');if (!textareaInput.value) {return }if (!validJSON(textareaInput.value)) {markError(new Error('JSON格式错误!'), textareaInput);return;}try {const jsonObj = JSON.parse(textareaInput.value);textareaInput.value = JSON.stringify(jsonObj, null, 2);textareaInput.classList.remove('error');toolTop.textContent = '格式化成功!';toolTop.style.color = '#12a793';} catch (error) {markError(error, textareaInput);toolTop.textContent = 'JSON格式错误:' + error.message;toolTop.style.color = '#ff4343';}}// 压缩jsonconst compressJson = ()=> {const textareaInput = document.getElementById('textareaInput');const toolTop = document.getElementById('toolTop');if (!textareaInput.value) {return }if (!validJSON(textareaInput.value)) {markError(new Error('JSON格式错误!'), textareaInput);return;}try {const jsonObj = JSON.parse(textareaInput.value);textareaInput.value = JSON.stringify(jsonObj);textareaInput.classList.remove('error');toolTop.textContent = '压缩成功!';toolTop.style.color = '#12a793';} catch (error) {markError(error, textareaInput);toolTop.textContent = 'JSON格式错误:' + error.message;toolTop.style.color = '#ff4343';}}// 错误提示const markError = (error, textareaInput) => {const toolTop = document.getElementById('toolTop');textareaInput.classList.add('error');let text = textareaInput.value;try {JSON.parse(text);} catch (e) {let match = e.message.match(/position (\d+)/);if (match) {let pos = parseInt(match[1]);let lines = text.substring(0, pos).split('\n');let line = lines.length;let column = lines[lines.length - 1].length + 1;let errorChar = text[pos] || ' ';let formattedText = text.split('\n').map((l, i) => {return `<span class="line_number">${i + 1}</span>${l}`;}).join('\n');let highlightedText = formattedText.substring(0, pos) + '<span class="error_content">' + errorChar + '</span>' + formattedText.substring(pos + 1);toolTop.innerHTML = `JSON格式错误:错误位于第 ${line} 行, 第 ${column} 列<br><br>` + highlightedText;return;}}toolTop.textContent = 'JSON格式错误:' + error.message;toolTop.style.color = '#ff4343';}// 清空errorconst clearError = ()=> {document.getElementById('textareaInput').classList.remove('error');document.getElementById('toolTop').textContent = '';}</script>
</body>
</html>

http://www.dtcms.com/wzjs/424913.html

相关文章:

  • 为什么网站要用外链seo网站运营
  • wordpress网站实例全网搜索软件下载
  • 福田网站建设哪家好百度人工服务热线电话
  • 大连网站建设价格低简述网站内容如何优化
  • 网站建设实训的意义b站推广网站2023
  • 和国外做贸易用什么网站免费的网站推广方法
  • wordpress运行环境手机关键词seo排名优化
  • 水利部网站建设管理司重庆seo公司怎么样
  • 贵州省冶金建设有限公司网站免费发布友链
  • 制作一个自适应网站品牌策划是做什么的
  • 彩票网站开发制作平台软件重庆企业免费建站
  • 郑州做网站哪里便宜搜索引擎营销的特点是
  • 网站做的跟别人的一样可以吗网站怎么接广告
  • 番禺做网站哪家强深圳最新疫情
  • 沈阳有资质做网站的公司有哪些网站检测中心
  • 湘潭做网站选择磐石网络手机优化助手下载
  • 代理服务器上外网合肥seo管理
  • 中小企业经营管理培训班优化算法
  • 精品课程网站设计百度链接
  • 北京手机网站建设公司排名深圳百度推广客服
  • 网站开发公司哪家好给你一个网站seo如何做
  • 企信宝企业信息查询平台做网站怎么优化
  • 用vs2012做asp网站2022最近比较火的营销事件
  • 怎样做营销型网站百度拉新推广平台
  • 关键词排名优化流程搜索引擎营销简称seo
  • 通州网站建设是什么班级优化大师下载
  • 济南免费建站做引流推广的平台
  • 南昌政府网站建设网络营销优化推广公司
  • 如何制作简易个人网站系统优化大师官方下载
  • 东莞网上申报系统百度seo引流