对于那些启用了javascript的用户,点击它们应该执行OnClick()
对于那些禁用了javascript的用户,请点击它们,只需转到somewhere.html,
假设只有$('#link')可以访问,怎么做?
我想知道是否可以在html标签上同时使用onclick和href,并优先于href上的onclick.我只想拥有机器人/旧浏览器可访问性的href.
谢谢
例如,通过添加http://mysite.com?url= infront 替换div元素中的所有href .如果HTML是...
<div class="post-body">
<a href="http://www.google.com">google</a>
<a href="http://www.youtube.com">youtube</a>
<a href="http://www.facebook.com">facebook</a>
</div>
Run Code Online (Sandbox Code Playgroud)
通过添加http://mysite.com?url= infront来替换每个href,这样html的结果将是......
<div class="post-body">
<a href="http://mysite.com?url=http://www.google.com">google</a>
<a href="http://mysite.com?url=http://www.youtube.com">youtube</a>
<a href="http://mysite.com?url=http://www.facebook.com">facebook</a>
</div>
Run Code Online (Sandbox Code Playgroud) 我的目录结构里面有一个html深入c:\。一行是这样的:
<link type="text/css" rel="stylesheet" href="/s/2036/21/2/_/download/superbatch/css/batch.css" media="all">
Run Code Online (Sandbox Code Playgroud)
当我将鼠标悬停在链接上时,它显示file:///C:/s/2036/21/2/_/download/superbatch/css/batch.css为链接地址。我希望它解释为实际位置file:///C:/Users/name/folder1/...some folders/s/2036/21/2/_/download/superbatch/css/batch.css
需要进行哪些更改?
编辑:有几个包含相对链接的文件,所以我不能只编辑每个文件。
附言:如果此标题的表现力不足,请将其更改为更好的标题。
您好我正在尝试更改链接标记的href,以便在按下按钮时加载新的样式表.这是我到目前为止 -
function addcss()
{
var findlink = document.getElementsByTagName("link");
findlink.href = "stylesheetxhtml.css";
}
Run Code Online (Sandbox Code Playgroud)
任何帮助非常感谢谢谢
我在wordpress http://heather.stevenspiel.com/上有一个简单的博客,我正在努力使标题标题成为主页的链接.我进入了header.php并重写了该部分的脚本,但仍无法获得工作链接.
这就是我重写的内容:
<h1>
<a href="http://heather.stevenspiel.com/" style="cursor:pointer !important;">My Spiel</a>
<br/>
</h1>
Run Code Online (Sandbox Code Playgroud)
我知道由于css颜色的变化,href正在注册.
这是以前的代码:
<h1>
<?php
if ($balloons_option['balloons_site-title_line1'] == '' && $balloons_option['balloons_site-title_line2'] == '') { ?>
This is a<br />
WordPress theme
<?php } else {
echo $balloons_option['balloons_site-title_line1']; ?><br />
<?php echo $balloons_option['balloons_site-title_line2'];
} ?>
</h1>
Run Code Online (Sandbox Code Playgroud)
我最初尝试将href放在h1之外,但仍然没有运气.
是否有一些隐藏的Wordpress设置会禁用可点击的标题?或者是否有一些我应该注意的JavaScript是禁用它?
我还应该注意标题的css包含一个z-index.我读到某处可能会受到影响:
#header .content {
line-height: 18px;
margin: 0;
z-index: 4;
}
Run Code Online (Sandbox Code Playgroud)
如果z-index正在影响它,那为什么呢?
我试图href通过jQuery 改变,但我不知道为什么它不工作...
$(document).ready(function () {
var oldurl = $('`http://google.com`');
var newurl = $('`http://yahoo.com`');
$('a[href="' + oldurl + '"]').attr('href', newurl);
// it's not working too...
//$('a[href="http://google.com"]').attr('href', 'http://yahoo.com');
// it's not working too...
//$('.mylink').attr('href', newurl);
});
Run Code Online (Sandbox Code Playgroud)
新年快乐!
不确定你们是否都可以帮助我 - 我是程序员的FAR! - 但完全难倒.我通常可以通过这样的改变混淆我的方式但是,失去了这个.
如果我使用Firebug查看我的网站 - 并查看下面的代码 - 并在Firebug控制台中编辑"email"行并将其更改为:
<a href="mailto:support@technologysolutionslive.com?subject=HELP">Send Email</a>
Run Code Online (Sandbox Code Playgroud)
它的工作原理 - 就像我想要的那样.
但是对于我的生活,我找不到文件/在哪里/要编辑什么来添加这个html,以便为我的用户点击该文本行.
有人可以指出我可能找到这个文件的方式吗?谢谢!抢
<div id="top-bar" class="text-center top-bar-hide" role="complementary" style="visibility: visible; margin-top: 0px;">
<div class="wf-wrap">
<div class="wf-table wf-mobile-collapsed">
<div class="wf-td">
<div class="mini-contacts wf-float-left">
<ul>
<li class="email">support@technologysoloutionslive.com</li>
<li class="skype">TSLHelpdesk</li>
<li class="clock">Standard SLA support is available M-F, 7AM-7PM EST</li>
</ul>
</div>
<div class="soc-ico show-round">
</div>
</div>
</div>
<span class="act"></span>
</div>
Run Code Online (Sandbox Code Playgroud) 有人可以解释为什么我的链接不起作用吗?
<!-- Optional theme this one is ok -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">Run Code Online (Sandbox Code Playgroud)
<button type="button" class="btn btn-primary" href="#">Get your Free Quote now!</button>Run Code Online (Sandbox Code Playgroud)
我的Angular网站应用程序中有一个33 KB的pdf文件,位于
src/app/components/landing-page/res/File.pdf
在位于着陆页文件夹中的我的着陆页.component.html中,我写了以下几行以允许下载文件。
My File <a href="./res/File.pdf" download="File.pdf">here</a>.
Run Code Online (Sandbox Code Playgroud)
但是,当我使用ng serve在浏览器中打开应用程序,然后单击链接时,将File.pdf下载无法打开的705B。该超链接显示为已链接http://localhost:4200/res/File.pdf,我认为这是问题的根源,因为此文件路径可能仅在角度框架中有效。