当前位置:首页 > 代码 > 正文

搜索页面代码(搜索页面的代码)

admin 发布:2022-12-19 20:02 143


本篇文章给大家谈谈搜索页面代码,以及搜索页面的代码对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

怎么看一个网站的源代码,网页源代码怎么看

怎么看一个网站的源代码?很简单,现在的浏览器基本上都支持查看源代码的,下面我们来看一下。

01

先打开要查看源代码的网站,比如搜狗搜索。

02

右键点击页面空白地方,然后点击菜单上的‘显示网页源代码’。

03

点击后,就会在新标签上打开显示网页的代码了。

04

如果你只要查看某个部分的源代码,我们可以先在网页上该部分控件上右键点击,然后点击‘检查’。

05

点击后,就会在浏览器下方显示出该部分所在的代码了。

如何制作网页的搜索代码

针对这个问题介绍—下如何用“SearchEngineBuilder”这个软件来制作纯HTML环境下的站内搜索引擎。

SearchEngineBuilder译为“搜索引擎工厂”,

下面以1.589版本(软件大小为593kB)为例说明如何用它来建立自己的站内搜索引擎。软件运行后,点击“Folder”按钮,在弹出的窗口中选定要列入搜索引擎的目录,点击“确定”按钮。

接下来要对生成的搜索引擎进行必要的设置。首先,点击“Option”按钮,在“Links”标签页内设置搜索结果中的超级链接情况,“UseRelativeLinks”为使用相对链接,“UseAbsoluteLinks”表示使用绝对链接,此时要在下面的“URLorPath”中输入自己网站的名称。

在“Files”标签页内设置的是哪些类型的文件将被收入搜索引擎中。点击“Template”标签,在这里设置使用哪种类型的搜索页面。软件内置了“Simple”、“MenuBar”、“Advanced”三种样式的搜索页面,在“Template”中选中它,点击“Preview”按钮可以进行预览,点击“Edit”按钮则可以对源代码进行修改,将其改为自己喜欢的格式。

在“Output”标签页是设定生成搜索引擎所用文件的输出位置以及搜索结果是在当前页打开还是另开新页面,此外还可以设置搜索以及搜索结果页面的文字大小和颜色等。这些按需要进行设置即可。全部设置完毕后,点击“确定”按钮返回主界面。

在主界面内点击“Make”按钮,软件就会生成搜索引擎,同时打开输入目录,把所生成的目录放到网站的目录中,双击“Search.html”即可启动搜索引擎进行搜索。

接下来这一步非常简单,你只要把所生成的文件放到网站的根目录下,然后在首页内为其做一个链接就可以了。

怎么样,为自己制作一个搜索引擎非常简单吧!如果你英文不太好的话,就用中文汉化版吧,在可以到

uilder.htm

进行下载。

搜索页面全代码

参考资料:

vue实现搜索历史

!doctype html

html

head

meta charset="utf-8"

title/title

meta name="viewport"

content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /

link href="css/mui.css" rel="stylesheet" /

style type="text/css"

body {

background-color: #FFFFFF;

}

/style

/head

body

div id="app"

header class="mui-bar mui-bar-nav"

a onclick="javascript:history.back(-1);"

class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"/a

h1 class="mui-title"搜索内容/h1

/header

div style="height: 50px;"/div

div style="display: flex;margin: 10px auto 0px auto;margin-left: 20px;"

div style="width: 80%;position: relative;"

!-- 搜索按钮 --

input type="submit" value=""

style="border: none;background-color: transparent;background-image:url(images/ss.png);width: 25px;height: 25px;position: absolute;left: 15px;top: 7px;background-size: 100% 100%;"

!-- 搜索文本 --

input v-model="input"

style="border: none;border-radius: 20px;width: 100%;background-color: #DCDCDC;padding-left: 20%;"

type="text" placeholder="请输入你想要的"

/div

div

button style="border: none;height: 40px;color: #FF0000;font-size: 17px;"

@click="handleSearchResult(input)"搜索/button

/div

/div

div

div

style="display: flex;justify-content: space-between;width: 85%;margin: 0 auto;align-items: center;font-size: 15px;"

div热门搜索/div

/div

div style="display: flex;width: 85%;flex-wrap: wrap;margin: 0 auto;margin-top: 2%;"

div style="width: auto;background-color: #FFE5E5;color: #FF0000;padding: 2%;border-radius: 10px;font-size: 14px;margin: 2% 2% 0px 0px;"

v-for="(i,index) in rmlist" :key="index"{{i}}/div

/div

/div

div style="margin-top: 20px;"

div

style="display: flex;justify-content: space-between;width: 85%;margin: 0 auto;align-items: center;font-size: 15px;"

div历史搜索/div

div style="color: #FF0000;" @click="clearHistory"清空/div

/div

div style="display: flex;width: 85%;flex-wrap: wrap;margin: 0 auto;margin-top: 2%;"

div v-if="historyList.length == 0" style="color: #CCCCCC;font-size: 12px;"暂无搜索记录/div

div v-else v-for="(historyItem, index) in historyList" :key="index"

@click="handleSearchResult(historyItem)"

style="width: auto;background-color: #FFE5E5;color: #FF0000;padding: 2%;border-radius: 10px;font-size: 14px;margin: 2% 2% 0px 0px;"

{{historyItem}}

/div

/div

/div

/div

script src=""/script

script type="text/javascript"

var vm = new Vue({

el: '#app',

data: {

input: '',

historyList: [],

rmlist: ['男装', '女装', '休闲裤', '鸿星尔克', '蔬菜']

},

mounted() {

if (localStorage.getItem('localHistory') !== null) {

this.historyList = localStorage.getItem('localHistory').split('|')

}

},

methods: {

handleSearchResult (val) {

      if (val === '') {

        alert('请输入搜索内容!')

        return

      }

      this.setlocalHistory(val) // 将搜索值加入本地localStorage

      this.historyList = localStorage.getItem('localHistory').split('|') // 从本地localStorage取出搜索历史并展示

      this.input = '' // 清空输入框

      // alert(`跳转至 ${val} 搜索结果页`) // 跳转至搜索结果页

    },

  setlocalHistory (val) {

      val = val.trim()

      let localHistory = localStorage.getItem('localHistory')

      if (localHistory === null) {

        localStorage.setItem('localHistory', val) // 若未设置过则直接设置本地存储

      }else {

        let localHistoryArray = localHistory.split('|').filter(item = item != val) // 删除搜索历史中与本次输出重复项

        if (localHistoryArray.length 0) {

          localHistory = val + '|' + localHistoryArray.join('|') // 新增记录

        }

        if (localHistory.split('|').length 10) { // 最大历史搜索记录10条

          localHistoryArray = localHistory.split('|')

          localHistoryArray.pop() // 删除最旧一项

          localHistory = localHistoryArray.join('|')

        }

        localStorage.setItem('localHistory', localHistory) // 存入本地

      }

    },

clearHistory () {

      localStorage.removeItem('localHistory') // 清空搜索历史

      this.historyList = []

    }

}

})

/script

script src="js/mui.js"/script

script type="text/javascript"

mui.init()

/script

/body

/html

搜索页面代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于搜索页面的代码、搜索页面代码的信息别忘了在本站进行查找喔。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/21911.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载