景区网站建设策划书/网络营销有什么方式

景区网站建设策划书,网络营销有什么方式,专业的移动网站建设,做网站主要来源* BootStrap弹框 功能:不离开当前页面,显示单独内容,供用户操作 步骤: 1、引入bootstrap.css和bootstrap.js 2、准备弹框标签,确认结构 3、通过自定义属性,控制弹框的显示和隐藏 其中的bootstrap.css…

* BootStrap弹框

功能:不离开当前页面,显示单独内容,供用户操作

步骤:

1、引入bootstrap.css和bootstrap.js

2、准备弹框标签,确认结构

3、通过自定义属性,控制弹框的显示和隐藏

其中的bootstrap.css链接为:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

bootstrap链接为:

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

以下是模板代码:

      <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h1 class="modal-title fs-5" id="exampleModalLabel">Modal title</h1><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body">...</div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button><button type="button" class="btn btn-primary">Save changes</button></div></div></div></div>

利用自定义属性控制弹框的显示和隐藏

data-bs-toggle="modal"

data-bs-target="#exampleModal"

示例的按钮:

<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">Launch demo modal
</button>

如果使用js进行控制:

        //创建弹框对象const modal=new bootstrap.Modal('css选择器')//显示弹框modal.show()//隐藏弹框modal.hide()

1、渲染列表

自己的图书数据:给自己起个外号,并告诉服务器,默认会有三本书,基于这三本书做数据的增删改查

其中的图书列表接口为:

http://ajax-api.itheima.net/api/books

首先基本的html与css代码为以下:

    <!-- 操作列 --><div class="head"><h1 class="title">图书管理</h1><button class="add_btn">添加</button></div>
    <!-- 图书管理列表 --><table><thead><tr><th>序号</th><th>书名</th><th>作者</th><th>出版社</th><th>操作</th></th></thead><tbody><!-- <tr><th>1</th><th>《java程序设计》</th><th>xxx</th><th>高等教育出版社</th><th><span class="del">删除</span><span class="edi">编辑</span></th></tr> --></tbody></table>

以下代码为使用BooyStrap的添加图书弹窗

    <!-- 添加图书弹窗 --><div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h1 class="modal-title fs-5" id="exampleModalLabel">图书管理</h1><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><div>书名</div><input class="bookname" type="text" placeholder="请输入书籍名称"><div>作者</div><input class="author" type="text" placeholder="请输入作者名称"><div>出版社</div><input class="publisher" type="text" placeholder="请输入出版社名称"></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button><button type="button" class="btn btn-primary">确定</button></div></div></div></div>

下面为添加图书的js部分:

        const tbody=document.querySelector('tbody')function getBook() {axios({url:'http://ajax-api.itheima.net/api/books'}).then(res => {console.log(res)tbody.innerHTML=res.data.data.map((item,index) =>`<tr><th>${index+1}</th><th>${item.bookname}</th><th>${item.author}</th><th>${item.publisher}</th><th class='${item.id}'><span class="del">删除</span><span class="edi">编辑</span></th></tr>`)})}getBook()// 添加图书操作//创建弹框对象const modal=new bootstrap.Modal('.modal')const add_btn=document.querySelector('.add_btn')        const bookDec=document.querySelectorAll('.modal-body input')//显示弹框        add_btn.addEventListener('click',() => {for(let i=0;i<bookDec.length;i++){bookDec[i].value=null}modal.show() })// 添加图书操作document.querySelector('.btn-primary').addEventListener('click',() =>{axios({url:'http://ajax-api.itheima.net/api/books',method:'post',data:{bookname: bookDec[0].value,author:bookDec[1].value,publisher:bookDec[2].value}}).then(res => {getBook()modal.hide()})})

2、删除数据

当点击删除按钮时,该行的数据将会被删除,并在页面中重新渲染

        // 删除操作document.querySelector('tbody').addEventListener('click',e => {if(e.target.className==='del'){console.log(e.target.parentNode.className);const id=e.target.parentNode.classNameaxios({url:`http://ajax-api.itheima.net/api/books/${id}`,method:'delete'}).then(res => {getBook()})}})

3、修改数据

修改数据部分包括了数据回显以及修改数据

当点击编辑按钮时,会弹出编辑图书弹框

      <!-- 编辑图书弹窗 --><div class="modal fade modal_edi" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h1 class="modal-title fs-5" id="exampleModalLabel">图书管理</h1><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body modal_body_edi"><div>书名</div><input class="bookname" type="text" placeholder="请输入书籍名称"><div>作者</div><input class="author" type="text" placeholder="请输入作者名称"><div>出版社</div><input class="publisher" type="text" placeholder="请输入出版社名称"></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button><button type="button" class="btn btn-primary edi_btn">修改</button></div></div></div></div>

再修改数据后,点击修改按钮,将进行修改

       // 点击编辑,获取图书信息const modal_edi=new bootstrap.Modal('.modal_edi')const modal_body_edi=document.querySelectorAll('.modal_body_edi input')document.querySelector('tbody').addEventListener('click',e => {if(e.target.className==='edi'){modal_edi.show()console.log(e.target.parentNode.parentNode.children[0]);const id=e.target.parentNode.classNameaxios({url:`http://ajax-api.itheima.net/api/books/${id}`}).then(res => {console.log(res.data.data)modal_body_edi[0].value=res.data.data.booknamemodal_body_edi[1].value=res.data.data.authormodal_body_edi[2].value=res.data.data.publisher//点击修改按钮,对图书信息进行修改document.querySelector('.edi_btn').addEventListener('click',() => {axios({url:`http://ajax-api.itheima.net/api/books/${id}`,method:'put',data:{bookname:modal_body_edi[0].value,author:modal_body_edi[1].value,publisher:modal_body_edi[2].value}}).then(edi_res =>{getBook()})modal_edi.hide()})}).catch(err => console.log(err))}})

* 图片上传

1、获取图片文件对象

2、使用FormData携带图片文件

const fd=new FormData()
fd.append(参数名,值)

3、提交表单数据到服务器,使用图片url网址

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/896052.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

AI Agent Service Toolkit:一站式大模型智能体开发套件

项目简介 该工具包基于LangGraph、FastAPI和Streamlit构建,提供了构建和运行大模型Agent的最小原子能力,包含LangGraph代理、FastAPI服务、用于与服务交互的客户端以及一个使用客户端提供聊天界面的Streamlit应用。用户可以利用该工具包提供的模板快速搭建基于LangGraph框架…

论文概览 |《Urban Analytics and City Science》2023.10 Vol.50 Issue.8

本次给大家整理的是《Environment and Planning B: Urban Analytics and City Science》杂志2023年10月第50卷第8期的论文的题目和摘要&#xff0c;一共包括21篇SCI论文&#xff01; 论文1 Advances in geospatial approaches to transport networks and sustainable mobility …

大语言模型推理能力从何而来?

前言 DeepSeek R1采用强化学习进行后训练&#xff0c;通过奖励机制和规则引导模型生成结构化思维链&#xff08;CoT&#xff09;&#xff0c;从而显著提升了推理能力。这一创新方法使得DeepSeek R1能够在无需大量监督数据的情况下&#xff0c;通过自我进化发展出强大的推理能力…

STM32MP157A单片机移植Linux驱动深入版

需求整理 在Linux设备树中新增leds节点&#xff0c;其有3个gpio属性&#xff0c;分别表示PE10对应led1&#xff0c;PF10对应led2&#xff0c;PE8对应led3&#xff0c;设备树键值对如下&#xff1a; leds { led1-gpio <&gpioe 10 0>; led2-gpio &l…

http代理IP怎么实现?如何解决代理IP访问不了问题?

HTTP代理是一种网络服务&#xff0c;它充当客户端和目标服务器之间的中介。当客户端发送请求时&#xff0c;请求首先发送到代理服务器&#xff0c;然后由代理服务器转发到目标服务器。同样&#xff0c;目标服务器的响应也会先发送到代理服务器&#xff0c;再由代理服务器返回给…

Grok 3.0 Beta 版大语言模型评测

2025年2月17日至18日&#xff0c;全球首富埃隆马斯克&#xff08;Elon Musk&#xff09;携手其人工智能公司xAI&#xff0c;在美国重磅发布了Grok 3.0 Beta版。这款被誉为“迄今为止世界上最智能的语言模型”的AI&#xff0c;不仅集成了先进的“DeepSearch”搜索功能&#xff0…

基于COSTAR模型的内容创作:如何用框架提升写作质量

目录 前言1. Context&#xff08;上下文&#xff09;&#xff1a;理解背景&#xff0c;奠定写作基础1.1 何为上下文1.2 上下文的作用1.3 案例解析 2. Objective&#xff08;目标&#xff09;&#xff1a;明确写作方向&#xff0c;避免跑题2.1 确立目标2.2 如何设定目标2.3 案例…

Springboot应用开发工具类整理

目录 一、编写目的 二、映射工具类 2.1 依赖 2.2 代码 三、日期格式 3.1 依赖 3.2 代码 四、加密 4.1 代码 五、Http请求 5.1 依赖 5.2 代码 六、金额 6.1?代码 七、二维码 7.1 依赖 7.2 代码 八、坐标转换 8.1 代码 九、树结构 9.1?代码 9.1.1 节点 …

【Research Proposal】基于提示词方法的智能体工具调用研究——研究问题

博客主页&#xff1a; [小ᶻ☡꙳ᵃⁱᵍᶜ꙳] 本文专栏: AIGC | ChatGPT 文章目录 &#x1f4af;前言&#x1f4af;研究问题1. 如何优化提示词方法以提高智能体的工具调用能力&#xff1f;2. 如何解决提示词方法在多模态任务中的挑战&#xff1f;3. 如何通过提示词优化智能体…

Java 大视界 -- 国际竞争与合作:Java 大数据在全球市场的机遇与挑战(94)

&#x1f496;亲爱的朋友们&#xff0c;热烈欢迎来到 青云交的博客&#xff01;能与诸位在此相逢&#xff0c;我倍感荣幸。在这飞速更迭的时代&#xff0c;我们都渴望一方心灵净土&#xff0c;而 我的博客 正是这样温暖的所在。这里为你呈上趣味与实用兼具的知识&#xff0c;也…

25旅游管理研究生复试面试问题汇总 旅游管理专业知识问题很全! 旅游管理复试全流程攻略 旅游管理考研复试真题汇总

旅游管理复试很难&#xff1f;&#xff01; 别怕&#xff01;经验超丰富的老学姐来给你们出谋划策啦&#xff01; 最近是不是被旅游管理考研复试折磨得够呛&#xff1f;莫慌&#xff01;我这有着丰富复试指导经验的老学姐来帮你们排雷&#xff0c;助力大家顺利上岸&#xff01…

美的楼宇科技基于阿里云 EMR Serverless Spark 构建 LakeHouse 湖仓数据平台

作者&#xff1a;美的楼宇科技事业部 先行研究中心智能技术部 美的楼宇科技 IoT 数据平台建设背景 美的楼宇科技事业部&#xff08;以下简称楼宇科技&#xff09;是美的集团旗下五大板块之一&#xff0c;产品覆盖多联机组、大型冷水机组、单元机、机房空调、扶梯、直梯、货梯…

2025asp.net全栈技术开发学习路线图

2025年技术亮点‌&#xff1a; Blazor已全面支持WebAssembly 2.0标准 .NET 8版本原生集成AI模型部署能力 Azure Kubernetes服务实现智能自动扩缩容 EF Core新增向量数据库支持特性 ‌ASP.NET 全栈开发关键技术说明&#xff08;2025年视角&#xff09;‌ 以下技术分类基于现…

Linux设备驱动-练习

练习要求&#xff1a; 一、设备树 1、配置设备树信息&#xff1a;将3个led灯和1个风扇使用到的设备信息配置到设备树中 二、设备驱动层 1、通过of_find_node_by_name、of_get_named_gpion等内核核心层统一的api接口调用外设&#xff1b; 2、通过udev设备管理器自动注册并创建设…

竞争与冒险问题【数电速通】

时序逻辑电路&#xff1a; 组合逻辑电路中的竞争与冒险问题&#xff1a; 在组合逻辑电路中&#xff0c;竞争和冒险是两种常见的时序问题&#xff0c;它们通常由电路的延时特性和不完美的设计引起。下面是这两种现象的详细解释&#xff1a; 1. 竞争&#xff08;Race Condition&…

Microsoft 365 Copilot中使用人数最多的是哪些应用

今天在浏览Microsoft 365 admin center时发现&#xff0c;copilot会自动整理过去30天内所有用户使用copilot的概况&#xff1a; 直接把这个图丢给copilot让它去分析&#xff0c;结果如下&#xff1a; 总用户情况 总用户数在各应用中均为 561 人&#xff0c;说明此次统计的样本…

ue5.2.1 quixel brideg显示asset not available in uAsset format

我从未见过如此傻x的bug&#xff0c;在ue5.2.1上通过内置quixel下载资源显示 asset not available in uAsset format 解决办法&#xff1a;将ue更新到最新版本&#xff0c;通过fab进入商场选择资源后add to my library 点击view in launcher打开epic launcher&#xff0c;就可…

Spring面试题2

1、compareable和compactor区别 定义与包位置:Comparable是一个接口&#xff0c;位于java.lang包,需要类去实现接口&#xff1b;而Compactor是一个外部比较器&#xff0c;位于java.util包 用法&#xff1a;Comparable只需要实现int compareTo(T o) 方法&#xff0c;比较当前对…

JUC并发—9.并发安全集合四

大纲 1.并发安全的数组列表CopyOnWriteArrayList 2.并发安全的链表队列ConcurrentLinkedQueue 3.并发编程中的阻塞队列概述 4.JUC的各种阻塞队列介绍 5.LinkedBlockingQueue的具体实现原理 6.基于两个队列实现的集群同步机制 4.JUC的各种阻塞队列介绍 (1)基于数组的阻塞…

vue项目启动时报错:error:0308010C:digital envelope routines::unsupported

此错误与 Node.js 的加密模块有关&#xff0c;特别是在使用 OpenSSL 3.0 及以上版本时。Vue 项目在启动时可能会依赖一些旧的加密算法&#xff0c;而这些算法在 OpenSSL 3.0 中默认被禁用&#xff0c;导致 error:0308010C:digital envelope routines::unsupported 错误。 解决…