Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/380.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 超链接目标_Javascript_Css_Html - Fatal编程技术网

Javascript 超链接目标

Javascript 超链接目标,javascript,css,html,Javascript,Css,Html,在HTML超链接中,有没有办法在第一页中显示第二页的内容 例如: 首页: <a href="image1.html">image1</a> <a href="image2.html">image2</a> <div> show image on first page here </div> 多谢各位 <iframe src="page.html" id="page"></iframe <a hre

在HTML超链接中,有没有办法在第一页中显示第二页的内容

例如:

首页:

<a href="image1.html">image1</a> <a href="image2.html">image2</a>

<div> show image on first page here </div>
多谢各位

<iframe src="page.html" id="page"></iframe
<a href="new.html" target="page">Open new.html in an iframe</a>
您可以使用iFrame。这将创建一个以page.html为源的iframe,以及一个将其切换到new.html的链接


您可以使用iFrame。这将创建一个以page.html作为其源的iframe,并创建一个链接,将其切换到new.html,我想您会使用。

我想您会使用。

我不知道为什么可能是因为您标记了javascript,我想您正在尝试在div中加载类似于ajax的内容:

<!DOCTYPE html>
<html lang="es">
<head>
  <title>Hope this helps!</title>
 </head>
 <body>

 <a href="#" id="secondpage">Second Page here!</a>

     <div id="hereitgoes">
     </div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

    <script type="text/javascript">
    $(document).ready(function() {  

            $('document').ready(function(){
                    $("#secondpage").click(function(){
                            $("#hereitgoes").load("secondpage.html");
                    });
            });
    });

    </script>
  </body>
</html>
记住,您必须在web服务器下运行它才能工作


希望它能帮助你,也希望它是你想要的

我不知道为什么,可能是因为您标记了javascript,我认为您正在尝试在div中加载类似于ajax的内容:

<!DOCTYPE html>
<html lang="es">
<head>
  <title>Hope this helps!</title>
 </head>
 <body>

 <a href="#" id="secondpage">Second Page here!</a>

     <div id="hereitgoes">
     </div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

    <script type="text/javascript">
    $(document).ready(function() {  

            $('document').ready(function(){
                    $("#secondpage").click(function(){
                            $("#hereitgoes").load("secondpage.html");
                    });
            });
    });

    </script>
  </body>
</html>
记住,您必须在web服务器下运行它才能工作

希望它能帮助你,也希望它是你想要的