我有以下html:
<div class="threeimages" id="txtCss">
<a>
<img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/>
</a>
<div class="text" id="txtLink">
<h2>
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a>
</h2>
<p>Land of the sunshine!</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
现在,如果你看到div ID"txtLink"中有href,即澳大利亚
我想在页面的运行时将相同的href值复制到div ID"txtCss"的上面标签中,我的意思是当我的页面显示时我的html将如下所示:
<div class="threeimages" id="txtCss">
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">
<img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/>
</a>
<div class="text" id="txtLink">
<h2>
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a>
</h2>
<p>Land of the sunshine!</p>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
请为上述问题提出一些代码
我的mailto网站的所有页面都有按钮,我想在电子邮件正文中写入该页面的引用.
在一个页面我可以
<a class="email" title="Email a friend" href="mailto:?subject=Interesting%20information&body=I thought you might find this information interesting:%20%0d%0ahttp://www.a.com/Home/SiteMap/tabid/589/Default.aspx">Email</a>
Run Code Online (Sandbox Code Playgroud)
但是,我怎样才能为所有页面制作这个通用名称?
嗨,我有一个noob问题,我想创建以下HTML结果:
<a href="/controller/action" class="button-big layer">TEXT<span class="arrow-big"></span></a>
Run Code Online (Sandbox Code Playgroud)
在上面的HTML中,我希望通过css将带有span-class的文本设置为图像样式.
当我尝试以下实现时,结果只反映了所需实现的一部分:
<%= link_to "TEXT", controller_path, :class => "button-big layer" %>
Run Code Online (Sandbox Code Playgroud)
结果是:
<a href="/controller/action" class="button-big layer">TEXT</a>
Run Code Online (Sandbox Code Playgroud)
和
<%= link_to(content_tag(:span, "", :class => "arrow-big"), controller_path, :class => "button-big layer") %>
Run Code Online (Sandbox Code Playgroud)
结果是:
<a href="/controller/action" class="button-big layer"><span class="arrow-big"></span></a>
Run Code Online (Sandbox Code Playgroud)
有谁知道怎么做?
我有两个HTML页面,example1.html和example2.html.
如何将变量传递example1.html给example2.html使用查询字符串,并在example2.html不使用任何服务器端代码的情况下检索该变量?
可能重复:
SRC和HREF之间的差异
在编写html/css时,似乎所有这些都完全相同.显然情况并非如此,如果你'href'什么时候应该'src',那你的时间会很糟糕.但我的问题是,是否有一种简单的方法可以记住哪些用途,以及何时使用它们?
<a href="#?cat=MT&typ=1" data-reveal-id="reveal_popup" onclick="pop();" data-closeonbackgroundclick="false" data-dismissmodalclass="close-reveal-modal">due today</a>
<a href="#?cat=MT&typ=2" data-reveal-id="reveal_popup" onclick="pop();" data-closeonbackgroundclick="false" data-dismissmodalclass="close-reveal-modal">due in 2 days</a>
<div id="reveal_popup" class="reveal-modal">
<div id="popup"></div>
<a class="close-reveal-modal">×</a>
</div>
function pop() {
var cat=**value of cat parameter in href**
var type=**value of typ parameter in href**
$.ajax({
type:'post',
url:site_url()+'/event/deleteEventSingle',
data:{'cat':cat,'type':typ},
async:false,
success:function(result){}
});
}
Run Code Online (Sandbox Code Playgroud)
在此用户单击href时,会出现具有不同数据的相同弹出窗口.实际上有超过10个hrefs,我试图在弹出窗口中显示用户输入数据的日历.这取决于两个参数cat和typ,如href所示.
每个href都有自己的cat和typ值.单击href时,我希望使用jquery获取所点击的href的cat和typ值,以便我可以在ajax中传递这些变量.
var cat=**value of cat parameter in href**
var type=**value of typ parameter in href**
Run Code Online (Sandbox Code Playgroud)
我尝试将文本框值发布到asp.net mvc中的actionresult
使用Javascript:
function OnButtonClick() {
var data= {
TextBox: TextBox.GetValue()
};
var PostData= data.TextBox;
window.location.href = "Home/MyActionResult?Page=data" + PostData;
}
Run Code Online (Sandbox Code Playgroud)
的ActionResult
public ActionResult MyActionResult(string PostData)
{
return view();
}
Run Code Online (Sandbox Code Playgroud)
每当我发布数据时Home/MyACtionResult,PostData始终是null,
我错过了什么?
如何将文本框值发布到actionresult?
在我的闪亮应用程序中,我想添加一个选项,让用户tab通过点击infoBox(或我想要的任何其他对象)跳转到应用程序中的特定元素(表格,情节,任何具有id的内容),当前或不同).
我的解决方案是围绕infoBox与div并添加href=#id_of_element属性.不幸的是,这个解决方案只适用tabs于额外的"data-toggle" = "tab"属性(它也不会改变打开tab的active),但这不是我想要的.
我的问题是:如何添加上述选项以及为什么此解决方案不起作用?这是我想要做的一个小例子:
UI
library(shiny)
library(shinydashboard)
shinyUI(
dashboardPage(
skin = "blue",
dashboardHeader(title = "Example"),
dashboardSidebar(
sidebarMenu(id = "sidebarmenu",
menuItem("Tab1", icon = icon("line-chart"),
menuSubItem("SubTab1", tabName = "sub1", icon = icon("bar-chart")),
menuSubItem("SubTab2", tabName = "sub2", icon = icon("database"))),
menuItem("Tab2", tabName = "tab2", icon = icon("users"))
)
),
dashboardBody(
tabItems(
tabItem(tabName = "sub1",
tags$div(href="#s2t2",
infoBox(value = "Go to table 2 in SubTab2 (not …Run Code Online (Sandbox Code Playgroud) 我是 html/css 的初学者。
我使用 PHP 在不同的网页中包含相同的标题部分。head 部分有一个 href 链接,链接到外部 css。用于设置多个网页布局样式的文件。
由于不同的网页位于根文件夹中的不同子文件夹中,因此我必须使用绝对路径来链接css。文件,问题来了:我不知道如何正确编写它。
当我对每个单独的网页使用相对路径时,链接工作正常,但当我尝试使用绝对路径时,它根本不起作用。
我努力了:
1.href="文件:///C:\xampp\htdocs\root\styles\style.css"
2.href="文件:///C:/xampp/htdocs/root/styles/style.css"
3.href="文件://C:/xampp/htdocs/root/styles/style.css"
4.href="C:/xampp/htdocs/root/styles/style.css"
5.href="c:/xampp/htdocs/root/styles/style.css"
这是代码的开始部分:
<!DOCTYPE html>
<html lang="en">
<head>
<?php include('common/head.php') ?>
<title>Home</title>
</head>
Run Code Online (Sandbox Code Playgroud)
这是头部:
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="file:///C:\xampp\htdocs\root\styles\style.css">
Run Code Online (Sandbox Code Playgroud) 我的意思是,就像一个 URL,用户可以单击该 URL 打开 Discord 应用程序或网站并预先编写一条 Discord 消息,准备发送。
我需要类似于mailto:链接的东西,我可以在其中将消息正文文本设置为参数或直接在 URL 中设置。
有这样的事情存在吗?任何帮助将非常感激。
href ×10
html ×6
javascript ×4
css ×2
asp.net-mvc ×1
content-tag ×1
discord ×1
jquery ×1
link-to ×1
local-files ×1
location ×1
query-string ×1
r ×1
shiny ×1
src ×1
url ×1
windows ×1