anchor

a vs a:link, What is the difference?

心不动则不痛 提交于 2019-11-28 17:05:15
问题 What is the differences between a {...} and a:link{...} ? Are there different usages, and benefits between them? 回答1: According to W3C a:link is for not visited, a:visited is for visited, and just a applies to both. 回答2: a covers all the bases. a:link is used only if the link in un- visited , un- hover ed, and in- active . So, use a for things like font-family (if you want links to come up in a different font), then use link for the standard formatting, and visited , hover and active for

How can I create an empty HTML anchor so the page doesn't “jump up” when I click it?

こ雲淡風輕ζ 提交于 2019-11-28 16:47:57
I'm working on some JQuery to hide/show some content when I click a link. I can create something like: <a href="#" onclick="jquery_stuff" /> But if I click that link while I'm scrolled down on a page, it will jump back up to the top of the page. If I do something like: <a href="" onclick="jquery_stuff" /> The page will reload, which rids the page of all the changes that javascript has made. Something like this: <a onclick="jquery_stuff" /> Will give me the desired effect, but it no longer shows up as a link. Is there some way to specify an empty anchor so I can assign a javascript handler to

Use jquery click to handle anchor onClick()

社会主义新天地 提交于 2019-11-28 16:16:51
问题 I have a set of dynamically generated anchor tags in a for loop as follows: <div id = "solTitle"> <a href = "#" id = "' + tagId + '" onClick = "openSolution();"> ' + solTitle + '</a></div> <br>'; Once this code is executed the html output for one of the case would look like: <div id = "solTitle"> <a href = "#" id = "solution0" onClick = "openSolution();">Solution0 </a></div> <br> <div id = "solTitle"> <a href = "#" id = "solution1" onClick = "openSolution();">Solution1 </a></div> <br> Now I

Is it possible to make an HTML anchor tag not clickable/linkable using CSS?

大憨熊 提交于 2019-11-28 13:49:22
问题 For example if I have this: <a style="" href="page.html">page link</a> Is there anything I can use for the style attribute that will make it so the link isn't clickable and won't take me to page.html? Or, is my only option to simply not wrap 'page link' in an anchor tag? Edit: I want to state why I want to do this so that people may be able to provide better advice. I am trying to set up my application so that the developer can choose what type of navigation style they want. So, I have a list

How to extract complete sub links using Simple-HTML-DOM?

流过昼夜 提交于 2019-11-28 12:22:44
问题 The following is the basic code I use to extract sublinks from a page: <?php include_once('simple_html_dom.php'); function extract_links($target_url) { $html = new simple_html_dom(); $html->load_file($target_url); $i=0; $crawl =array(); foreach($html->find('a') as $link) { $crawl[$i] = $link->href; $i++; } var_dump($crawl); } extract_links('http://stackoverflow.com'); ?> The output is as follows: array 0 => string 'http://stackexchange.com' (length=24) 1 => string '/users/login' (length=12) 2

Difference between text and textContent properties

时间秒杀一切 提交于 2019-11-28 11:55:41
According to the HTML5 specification and the DOM specification an HTMLAnchorElement has a text and a textContent property. What is the purpose of the text property? As far as I can tell text is just a read-only getter for textContent The textContent property is "inhertied" from the Node interface of the DOM Core specification. The text property is "inherited" from the HTML5 HTMLAnchorElement interface and is specified as "must return the same value as the textContent IDL attribute". The two are probably retained to converge different browser behaviour, the text property for script elements is

Linking from a web page to a specific section (anchor) in PDF document

烂漫一生 提交于 2019-11-28 11:52:53
There is a standard from Adobe that in theory specifies opening PDF documents from a link clicked in a browser in a way to open specific sections (AKA "anchor", "named reference") of PDF document. This functionality should be of great help if one would like to refer to a specific portion of large PDF (such as some standard or specification). However, from what I see now, support for this standard is close to non-existent. For example, these links should open Scala Reference PDF at section 3.2.6, "Annotated Types": http://www.scala-lang.org/docu/files/ScalaReference.pdf#subsection.3.2.6 http:/

Activate the tab of the location hash

泄露秘密 提交于 2019-11-28 11:24:01
问题 I have a structure of tabs with 3 levels: <!-- Nav tabs - First level --> <ul class="nav nav-tabs" role="tablist"> <li class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> <li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> </ul> <!-- Tab panes - First level --> <div class="tab-content"> <div class="tab-pane active" id="home"> <p>Home content.</p> <!-- Nav tabs - Second level --> <ul class="nav nav-tabs" role="tablist"> <li class="active"><a href="#home2"

Retrieving the url anchor in a werkzeug request

我们两清 提交于 2019-11-28 11:12:14
I have a DAV protocol that stores out-of-band data in the url anchor, e.g. the ghi in DELETE /abc.def#ghi . The server is a Flask application. I can see the request come in on the wire via tcpdump , but when I look at the werkzeug Request object (such as url() or base_url()), all I get back is /abc.def . The #ghi has been stripped out. Is there a method that returns this information, or do I have to subclass Request to handle this myself? If so, is there an example I can use as an inspiration? From Wikipedia ( Fragment Identifier ) (don't have the time to find it in the RFC): The fragment

window.location = #anchor doesn't work in IE

岁酱吖の 提交于 2019-11-28 10:33:49
On this map: http://web.pacific.edu/documents/marketing/campus-map/version%202/stockton-campus-2.0.htm I have an anchor at the top, and I want the page to jump to the anchor when a link is clicked. I'm currently using window.location = '#top'; It works as expected in FF, Opera, and Chrome, but not in IE 7. I've tried all permutations like window.location.hash and window.location.assign() and also scrollIntoView(true) and focus(). How can I make it work in IE? Edit : Nothing seems to work, which makes me think it's not the syntax, but something about the JS... here is the click event handler...