将图像包含在搜索结果中的Javascript代码

问题描述 投票:1回答:1

我正在尝试在容器中将图像与搜索结果一起显示,该容器很好地显示了相关的搜索结果,但我认为用于显示该图像的基于JavaScript的搜索引擎代码有问题,请帮忙。

var tipuesearch = {
  "pages": [
    {
      "title": "Flash",
      "image": "C:Users/user/Documents/pages/Images/Flash.jpg",
      "text": "The Flash is a trilling science fiction movie, based on Barry Allen",
      "url": "C:/Users/user/documents/resizable/Flash.html"
    }, 
  ]
};
javascript html css search
1个回答
1
投票

要访问您的图像和URL,您需要:

  1. fs npm软件包(可通过serverSide上的Node.js或客户端上的Webpack获得)
  2. 使用本地Web服务器,例如WAMP,XAMPP并相应地更改文件

var tipuesearch = {
  pages: [
    {
      title: 'Flash',
      image: 'http://localhost:8080/pages/Images/Flash.jpg',
      text:
        'The Flash is a trilling science fiction movie, based on Barry Allen',
      url: 'http://localhost:8080/resizable/Flash.html'
    }
  ]
};

© www.soinside.com 2019 - 2024. All rights reserved.