标签: href

如何在Perl中找到相对URL的完整URL?

我是perl的新手,但想知道是否有人知道一个类似于以下PHP版本的脚本,效果很好!

private function resolve_href ( $base, $href ) {
    if (!$href)
        return $base;
    $rel_parsed = parse_url($href);
    if (array_key_exists('scheme', $rel_parsed))
        return $href;
    $base_parsed = parse_url("$base ");
    if (!array_key_exists('path', $base_parsed))
        $base_parsed = parse_url("$base/ ");
    if ($href{0} === "/")
        $path = $href;
    else
        $path = dirname($base_parsed['path']) . "/$href";
    $path = preg_replace('~/\./~', '/', $path);
    $parts = array();
    foreach ( explode('/', preg_replace('~/+~', '/', $path)) as $part ) { 
        if ($part === "..")
            array_pop($parts);
        elseif ($part!="") 
            $parts[] = $part;
    }
    $dir =  ( ( array_key_exists('scheme', $base_parsed)) …
Run Code Online (Sandbox Code Playgroud)

url perl base href

1
推荐指数
1
解决办法
954
查看次数

href ='News.aspx?id = <%#Eval("id")%>'在LinkBut​​ton ASP.NET中不起作用

我想href='News.aspx?id=<%#Eval("id")%>'在linkbutton中使用,但它是非常有用的工作请求帮助我

asp.net href linkbutton

1
推荐指数
1
解决办法
1万
查看次数

document.location.href无法在Chrome浏览器中运行

命令:

document.location.href="www.google.com" 
Run Code Online (Sandbox Code Playgroud)

不会更改Google Chrome浏览器中的当前网页.该命令确实在IE9浏览器中传输页面.

为什么这个命令适用于IE9而不适用于chrome?

javascript location google-chrome href internet-explorer-9

1
推荐指数
2
解决办法
2万
查看次数

摆脱url href中的字符

我有这样的链接:

http://nl.wikipedia.org/wiki/Alexandra_Stan&sa=U&ei=UULHUIIdzPnhBOKMgPgJ&ved=0CCIQFjAA&usg=AFQjCNGyCikDkoZMnnuqGo6vjMQ6b5lZkw
Run Code Online (Sandbox Code Playgroud)

我想摆脱'&'开头的所有内容所以这会给我一个干净的网址:

http://nl.wikipedia.org/wiki/Alexandra_Stan
Run Code Online (Sandbox Code Playgroud)

我知道如何像这样替换href:

$('a').each(function() {
      $(this).attr("href", function(index, old) {
            return old.replace("something", "something else");
      });
});
Run Code Online (Sandbox Code Playgroud)

但我无法弄清楚如何摆脱从某个角色开始的一切.

javascript jquery href

1
推荐指数
1
解决办法
252
查看次数

PHP登录页面重定向

这段代码不完整,我需要它重定向到一个名为mainpage.php的页面,其中包含用户名和密码的硬编码信息.这是代码.

<?php
session_start();
$username="user";
$password="123";

if($_POST['username'] == $username && $_POST['password'] == $password)
?>

<html>
    <head>
    </head>
    <body>
        <div style='text-align:center'>
        <h3>Welcome To Kontak</h3>
        </div>
        <hr /><br />
        <form id='login' action="" method='post' accept-charset='UTF-8'>
            <fieldset style="width:550px">
            <legend>Admin Login</legend>
            <input type='hidden' name='submitted' id='submitted' value='1'/>

            <label for='username' >UserName:</label>
            <input type='text' name='username' id='username'  maxlength="50" />


            <label for='password' >Password:</label>
            <input type='password' name='password' id='password' maxlength="50" />

            <input type='submit' name='submit' value='Submit' />
            </fieldset>
        </form>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

php login href

1
推荐指数
1
解决办法
2万
查看次数

在codeigniter中获取文件下载链接

我正在尝试在我的Web应用程序中下载一些文件.显然我把要下载的文件放在controllers文件夹里面的文件夹中,有点类似于:

controllers/upload/project_name/bc68gdas9jfeh9yfj/file.dat
Run Code Online (Sandbox Code Playgroud)

显然我想下载file.dat但我不知道在我的标签中放入什么链接.我在href中放了什么,以便下载该文件?

php codeigniter download href

1
推荐指数
1
解决办法
9282
查看次数

<button>在chrome中工作但在Firefox中没有 - 为什么?

我的html页面上有几个按钮,如下所示:

<button type="button" class="read-more"><a href="#">Read More</a></button>
Run Code Online (Sandbox Code Playgroud)

他们在chrome和Safari中都很敏感 - 他们的工作非常好.但是,当我在mozzilla Firefox中测试它们时,它们根本没有响应.有谁知道这个问题是什么?

我尝试这样做:

<a href="#"> <button type="button" class="read-more">Read more</button></a>
Run Code Online (Sandbox Code Playgroud)

这链接按钮,但它没有显示可点击的光标,也没有拾取一些CSS(例如下划线和字体颜色)

html firefox mozilla href button

1
推荐指数
1
解决办法
3272
查看次数

单击上面的另一个元素时,Html不会转到A href位置

我想知道是否有可能阻止我按下div我的A标签中的href .我的div当前漂浮在我的A标签上position: absolute.

Jsfiddle我的问题:https://jsfiddle.net/ac80u7bd/

我需要css样式:position: relative在我的div方面阻止我的按钮粘在页面的左上角.我不确定这是否是导致问题的原因.

我的HTML看起来像这样:

<div class="image col-md-6">
  <a href="https://google.com">
    <img width="500" height="300" src="http://i.imgur.com/uR2o8pb.jpg">
  </a>
  <div class="edit-image">&middot;&middot;&middot;</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.image {
    padding: 8px;
    position: relative;
}

.image .edit-image{
    background-color: red;
    position: absolute;
    width: 100px;
    height: 100px;
    top: 15px;
    left: 15px;
    pointer-events: none;
    z-index: 100;
}
Run Code Online (Sandbox Code Playgroud)

单击<div class="edit-image">元素时是否可以不跟随href ?

html css href

1
推荐指数
1
解决办法
82
查看次数

我的html代码中的href链接不起作用.

我用HTML写了一个简单的网页:

<!DOCTYPE html>
<html>
<body>

<img src="http://media.web.britannica.com/eb-media/59/89959-050-6CC4DDA1.jpg" alt="WorldMap" usemap="#Map" />
<map name="WorldMap" id="Map">
    <area alt="NorthAmerica" title="" href="www.google.com" shape="rect" coords="307,181,488,250" />
    <area alt="SouthAmerica" title="" href="www.google.com" shape="rect" coords="468,504,636,432" />
    <area alt="Europe" title="" href="www.google.com" shape="rect" coords="853,147,1005,180" />
    <area alt="Africa" title="" href="www.google.com" shape="rect" coords="964,350,826,383" />
    <area alt="Asia" title="" href="www.google.com" shape="rect" coords="1115,232,1221,193" />
    <area alt="Australia" title="" href="www.google.com" shape="rect" coords="1270,564,1483,532" />
    [...]
</map>


</body>
</html>
Run Code Online (Sandbox Code Playgroud)

它返回一个世界地图,并应为每个大陆创建一个链接.

但是,链接不响应点击.

可能是什么问题?

html image href

1
推荐指数
1
解决办法
309
查看次数

资产未考虑基本href网址-找不到错误

我只是在Webform项目中复制了我的角度构建脚本,然后将该项目部署在IIS中。

注意:我只复制了脚本文件,没有在IIS中单独部署。

我已经在webform项目的Scripts文件夹内复制了angular dist文件夹。

现在我的基本网址是: http:// localhost / Angular2 /

-在角度我已经设置了基本href,以“../../Scripts/dist”里面的index.html文件。

一切工作正常,如路由,加载图像,js文件等。仅svg图标未加载,并出现404 Not Found错误。

对于Angular页面,除svg外,所有内容(css,jpg,js)均从http://localhost/Angular2/Scripts/dist/main.js等加载 。

但是svg图标正在尝试从路径
http://localhost/Angular2/assets/features/home.svg获取负载,而不是从http://localhost/Angular2/Scripts/dist/assets/features/home.svg

我不确定为什么对于svg图标,基本href无法正常工作。

下面是我使用材质库使用svg图标的代码。

constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
    iconRegistry.addSvgIcon('home', sanitizer.bypassSecurityTrustResourceUrl('/assets/features/home.svg'));
    iconRegistry.addSvgIcon('library', sanitizer.bypassSecurityTrustResourceUrl('/assets/features/library.svg'));
    iconRegistry.addSvgIcon('guest', sanitizer.bypassSecurityTrustResourceUrl('/assets/features/guest.svg'));
Run Code Online (Sandbox Code Playgroud)

如果我用下面的一行修改了上面的行,那么它工作正常。

constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
    iconRegistry.addSvgIcon('home', sanitizer.bypassSecurityTrustResourceUrl('Scripts/dist/assets/features/home.svg'));
    iconRegistry.addSvgIcon('library', sanitizer.bypassSecurityTrustResourceUrl('Scripts/dist/assets/features/library.svg'));
    iconRegistry.addSvgIcon('guest', sanitizer.bypassSecurityTrustResourceUrl('Scripts/dist/assets/features/guest.svg'));
Run Code Online (Sandbox Code Playgroud)

我可以知道为什么base href不申请SVG图标吗?

提前致谢。

assets base href http-status-code-404 angular

1
推荐指数
1
解决办法
1608
查看次数