Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/68.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 JQuery打印按钮未显示_Javascript_Jquery_Html - Fatal编程技术网

Javascript JQuery打印按钮未显示

Javascript JQuery打印按钮未显示,javascript,jquery,html,Javascript,Jquery,Html,我对jquery非常陌生,我试图用它在我非常简单的网页底部放置一个打印按钮,但我根本无法让它显示出来。(我将在页面上打印更多内容,我还没有包括它,因为它不是必需的)以下是我到目前为止的代码: <html> <head> <h1>This is my webpage</h1> </head> <body> <div class="col_2"> <script> <img src="print.p

我对jquery非常陌生,我试图用它在我非常简单的网页底部放置一个打印按钮,但我根本无法让它显示出来。(我将在页面上打印更多内容,我还没有包括它,因为它不是必需的)以下是我到目前为止的代码:

<html>
<head>
<h1>This is my webpage</h1>
</head>
<body>
<div class="col_2">
<script>
<img src="print.png" class="printMe" alt="Print" title="Print"></a>
$('.printMe').click(function(){
     window.print();
});
</script>
<img src="gvsu.png">
<a href="https://www.linkedin.com"><img src="linkedin.png" alt="HTML tutorial" width="42" height="42"></a>
<a href="https://www.twitter.com"><img src="twitter.png" alt="HTML tutorial" width="42" height="42"></a>
<a href="https://www.facebook.com"><img src="fb.png" alt="HTML tutorial" width="42" height="42"></a>
</div>
</body>
</html>

这是我的网页
$('.printMe')。单击(函数(){
window.print();
});
只要把你的

$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
})       
编辑:我为你重新组织了一下。通常,将脚本放在页面的头部或底部

只要把你的

$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
})       
编辑:我为你重新组织了一下。通常,将脚本放在页面的头部或底部

只要把你的

$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
})       
编辑:我为你重新组织了一下。通常,将脚本放在页面的头部或底部

只要把你的

$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
})       

编辑:我为你重新组织了一下。通常,将脚本放在页面的头部或底部

我重写了代码并添加了jquery库。这个版本很好用。用你自己的形象来代替

<html>
<head>
  <title> Hi </title>

</head>
<body>
    <div class="col_2">
    <h1>This is my webpage</h1>
    <img src="gvsu.png">
    <a href="https://www.linkedin.com"><img src="linkedin.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.twitter.com"><img src="twitter.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.facebook.com"><img src="fb.png" alt="HTML tutorial" width="42" height="42"></a>
    <img src="print.png" class="printMe" alt="Print" title="Print" />
    </div>
</body>
 <script>
    $(document).ready(function(){
     $('.printMe').click(function(){
         window.print();
     });

    })       
</script>
</html>

这是您的页面标题
这是我的网页
$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
});

我重写了代码并添加了jquery库。这个版本很好用。用你自己的形象来代替

<html>
<head>
  <title> Hi </title>

</head>
<body>
    <div class="col_2">
    <h1>This is my webpage</h1>
    <img src="gvsu.png">
    <a href="https://www.linkedin.com"><img src="linkedin.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.twitter.com"><img src="twitter.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.facebook.com"><img src="fb.png" alt="HTML tutorial" width="42" height="42"></a>
    <img src="print.png" class="printMe" alt="Print" title="Print" />
    </div>
</body>
 <script>
    $(document).ready(function(){
     $('.printMe').click(function(){
         window.print();
     });

    })       
</script>
</html>

这是您的页面标题
这是我的网页
$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
});

我重写了代码并添加了jquery库。这个版本很好用。用你自己的形象来代替

<html>
<head>
  <title> Hi </title>

</head>
<body>
    <div class="col_2">
    <h1>This is my webpage</h1>
    <img src="gvsu.png">
    <a href="https://www.linkedin.com"><img src="linkedin.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.twitter.com"><img src="twitter.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.facebook.com"><img src="fb.png" alt="HTML tutorial" width="42" height="42"></a>
    <img src="print.png" class="printMe" alt="Print" title="Print" />
    </div>
</body>
 <script>
    $(document).ready(function(){
     $('.printMe').click(function(){
         window.print();
     });

    })       
</script>
</html>

这是您的页面标题
这是我的网页
$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
});

我重写了代码并添加了jquery库。这个版本很好用。用你自己的形象来代替

<html>
<head>
  <title> Hi </title>

</head>
<body>
    <div class="col_2">
    <h1>This is my webpage</h1>
    <img src="gvsu.png">
    <a href="https://www.linkedin.com"><img src="linkedin.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.twitter.com"><img src="twitter.png" alt="HTML tutorial" width="42" height="42"></a>
    <a href="https://www.facebook.com"><img src="fb.png" alt="HTML tutorial" width="42" height="42"></a>
    <img src="print.png" class="printMe" alt="Print" title="Print" />
    </div>
</body>
 <script>
    $(document).ready(function(){
     $('.printMe').click(function(){
         window.print();
     });

    })       
</script>
</html>

这是您的页面标题
这是我的网页
$(文档).ready(函数(){
$('.printMe')。单击(函数(){
window.print();
});
});

为加快页面加载时间,脚本应位于页面底部,而不是页眉。只有CSS应该在页眉中。你应该把脚本放在页脚中,或者等到DOM准备好。将脚本包装在
$(document).ready()
中。为加快页面加载时间,脚本应位于页面底部,而不是页眉。只有CSS应该在页眉中。你应该把脚本放在页脚中,或者等到DOM准备好。将脚本包装在
$(document).ready()
中。为加快页面加载时间,脚本应位于页面底部,而不是页眉。只有CSS应该在页眉中。你应该把脚本放在页脚中,或者等到DOM准备好。将脚本包装在
$(document).ready()
中。为加快页面加载时间,脚本应位于页面底部,而不是页眉。只有CSS应该在页眉中。你应该把脚本放在页脚中,或者等到DOM准备好。将脚本包装在
$(document.ready()
中。