简体   繁体   English

将网站的一部分嵌入到另一个网站

[英]embed a part of a website to another website

Hi I'm trying to use/add the free map tools which I found on this site http://www.freemaptools.com/how-far-is-it-between.htm to my current websites which are a list of tools that are commonly used by our staff, I was planning to embbed it, however it doesn't seem to have that kind of feature, and I am asking you guys if you can offer me an alternative to the task that I want to do. 嗨,我正在尝试使用/添加我在此网站http://www.freemaptools.com/how-far-is-it-between.htm上找到的免费地图工具,并将其添加到当前的网站(这些网站是工具列表)中我们计划将其嵌入,但是我似乎没有这种功能,我问你们是否可以为我提供我想做的替代方案。 While doing this "ToolBox" I am also willing to make my own map tools that measures the distance between countries. 在执行此“工具箱”时,我也愿意制作自己的地图工具来测量国家之间的距离。 If you can kindly guide me. 如果可以的话请指导我。 Thank you. 谢谢。 Here's what I've got so far 这是到目前为止我得到的

Code: 码:

<form name="inp">
<table align="center" width="95%" border="0">
<tbody><tr>
    <td width="30"></td>
    <td align="right">City, Country</td>
    <td></td>
    <td>City, Country</td>
    <td width="30"></td>
</tr>

<tr>
<td width="30"></td>
 <td width="269" align="right">From 
<input name="pointa" type="text" value="" size="22" onkeypress="autocompletea(this.value, event)"></td>
<td width="34"><div align="center">to</div></td>
<td width="271"><input name="pointb" type="text" value="" size="22" onkeypress="autocompleteb(this.value, event)"> <input name="show" type="button" value="Show" onclick="findaandb(document.forms['inp']['pointa'].value,document.forms['inp']['pointb'].value);">
  <label></label></td>
<td width="30"></td>
</tr>
<tr>
<td colspan="2">
<div id="autocompletediva" class="autocomp" style="display: block; visibility: hidden; height: 0px; width: 0px;"></div>
</td>
<td></td>
<td colspan="2">
<div id="autocompletedivb" class="autocomp" style="display: block; visibility: hidden; height: 0px; width: 0px;"></div></td>
</tr>
<tr>
<td colspan="5"><div id="msg" class="msg">&nbsp;</div></td>
</tr>

<tr>
<td colspan="5" align="center"> Measure in :
<input name="dist" type="radio" onclick="toggleUnits('MILES');" checked="CHECKED">
<font face="verdana, geneva, helvetica" size="2">miles<input type="radio" name="dist" onclick="toggleUnits('KMS');">
 km</font>
</td>
</tr>

<tr><td colspan="5" align="center"><strong>Distance as the Crow Flies </strong> :
      <input style="display: inline;" id="distance" type="text" size="10" value="0.000" readonly="true"> 
      <img src="" alt="As the crow Flies"> </td>
</tr>
<tr>
<td colspan="5" align="center"><strong>Distance by Land Transport</strong> :
      <input style="display: inline;" id="transport" type="text" size="10" value="0.000" readonly="true">
      <img src="" alt="Land Transport"> 
</td>
</tr>
</tbody></table>
</form>

I think you're missing the javascript part 我认为您缺少javascript部分

onkeypress="autocompletea(this.value, event)"

onclick="toggleUnits('KMS');"

onclick="toggleUnits('MILES');"

These are all javascript function calls, but what you posted is only the HTML part. 这些都是javascript函数调用,但是您发布的只是HTML部分。 Quickly reviewing the web page you posted i think that at least you're missing the following JS file. 快速查看您发布的网页,我认为至少您缺少以下JS文件。 http://www.freemaptools.com/script/how-far-is-it-between.js http://www.freemaptools.com/script/how-far-is-it-between.js

Although i think that if you are missing this, may be because it is your first time you are creating a web page,HTML is only the layout and JavaScript enables you to "dynamize" the HTML (well, i think that many will disagree but it's kind of). 尽管我认为如果您缺少此功能,可能是因为这是您第一次创建网页,HTML只是布局,而JavaScript使您能够“动态化” HTML(嗯,我认为很多人会不同意,但是有点。

I recommend you to have a look at a JavaScript tutorial, i don't remeber any good right now, but sure that if you google for you will find many good tutorials around there. 我建议您看一下JavaScript教程,我现在不打算保留任何优点,但是请确保,如果您是google的用户,那么周围会发现很多不错的教程。

Hope helped 希望有所帮助

You can try "Iframe" or Jquery "load" function. 您可以尝试使用“ Iframe”或Jquery“加载”功能。

Here are some examples 这里有些例子

http://www.w3schools.com/jquery/jquery_ajax_load.asp http://www.w3schools.com/jquery/jquery_ajax_load.asp

http://www.w3schools.com/tags/tag_iframe.asp http://www.w3schools.com/tags/tag_iframe.asp

Hope this helps.... 希望这可以帮助....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM