anchor

Regex non-capturing group is capturing

余生长醉 提交于 2019-12-02 07:51:08
问题 I have this regex (?:\<a[^*]href="(http://[^"]+?|[^"]+?\.pdf)"+?[^>]*?)> The point of this regex is to capture every closing tag ('>') of an anchor that has an href that starts with "http://" or ends with ".pdf". The regex works, however it is capturing the first part of the anchor, which I absolutely need to NOT capture. In the following samples all are matching except second (which is fine) but only the last bracket should be captured and it is not the case. <a href="http://blabla">omg</a>

jQuery mobile Tabs and Anchors

我怕爱的太早我们不能终老 提交于 2019-12-02 07:31:06
I would like create a tabbed mobile page using jQuery Mobile. I have got the basics of creating tabs (For Example Tab1, Tab2, Tab3, Tab4) and having each tab load a new page of content. How would I go about using an anchor within a specific tab? So for example if someone wanted to bookmark a link that took them right to Tab4 Anchor1. I am pretty new to JavaScript and jQuery. Code below: <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>test</title> <link rel="stylesheet" href="http://code.jquery.com/mobile

.htaccess redirect anchor page/page#anchor to url

半世苍凉 提交于 2019-12-02 07:25:58
How do I redirect page/page#anchor to http://www.example.com/page/page . I tried the following code, but it's not working RewriteRule ^page/page#anchor http://www.example.com/page/page [NE,L] Could you please help me? Peter That can't be done on server side since URI component after # is handled by client side only. You can alternatively use this Javascript code to do the same: <script> if (location.href.indexOf("#") > -1) { location.assign(location.href.replace(/(page\/page)#anchor/i, "$1")); } </script> I believe the data after # is considered a fragment. Fragment data is not sent to the

How to prevent page refresh when <a> tag clicked?

大城市里の小女人 提交于 2019-12-02 07:24:15
问题 I need to pass a parameter into the URL and at the same time prevent page from reloading when I click any <a> tag with a blank href attribute ( <a href=""> ) Is there a way to do this with JS/jQuery? I have this jQuery already $('.list-group-item a').click(function (event) { event.preventDefault(); }); But when I click <a href="inbox/1">Message</a> (any anchor with an href) preventDefault stops that value from being passed into the url. Can anyone help? Thanks in advance. 回答1: window.location

Expanding a hidden div by referring with an anchor from external page

人盡茶涼 提交于 2019-12-02 07:18:56
问题 I have a script which hides (display:none) certain divs in the list on page load. Div contents represents description of a book, and the whole list is some sort of bibliography. Every div has an id, for example, "div1", "div2" etc. <ul> <li><div class="hidden" id="div1"></li> <li><div class="hidden" id="div1"></li> ... </ul> And there's another page with a menu, which consists of anchored links to every such a div: <ul> <li><a href="bibl.html#div1"></li> <li><a href="bibl.html#div2"></li> ...

Expanding a hidden div by referring with an anchor from external page

纵饮孤独 提交于 2019-12-02 06:52:23
I have a script which hides (display:none) certain divs in the list on page load. Div contents represents description of a book, and the whole list is some sort of bibliography. Every div has an id, for example, "div1", "div2" etc. <ul> <li><div class="hidden" id="div1"></li> <li><div class="hidden" id="div1"></li> ... </ul> And there's another page with a menu, which consists of anchored links to every such a div: <ul> <li><a href="bibl.html#div1"></li> <li><a href="bibl.html#div2"></li> ... </ul> I want the hidden div to autoexpand when the link on another page is clicked. I tried some

visited links won't underline

半世苍凉 提交于 2019-12-02 06:48:34
问题 My visited links for a web project won't underline, however, the rest of the visited modifications are working, and underline is working for hover. I showed my instructor this and he was confused, and said he would try to find time to look at it, however, the due date is nearing si I can no longer wait. Here is my the section of my layout page dealing with the anchor tag: a:link { text-decoration: none; color: #d1bd22; font-size: 1.3em; } a:visited { text-decoration: underline; color: white;

Updating keyboard focus when implementing the skip to main content technique through an anchor link

折月煮酒 提交于 2019-12-02 06:24:47
I'm implementing the skip to main content technique described in W3C's WCAG2.0 Techniques documentation , however I'm struggling to update the keyboard focus when activating the link. (Note that I'm testing this on the latest public version of Chrome). Firstly, here is my JavaScript function: function skipToMainContent() { var hash = window.location.hash.substring(1); if (hash === "main") { var el = document.getElementById(hash); el.tabIndex = 0; el.focus(); } } skipToMainContent(); What this function does is firstly pull the hash from the URL and remove the # ; then it checks if the value of

trigger a click on a anchor link

社会主义新天地 提交于 2019-12-02 03:17:51
I have a collection of links with thumbnails that match them. I need to load these thumbnails as divs with the background image set to them. I'm using a single image that has all thumbnails in them, so I can't just load the images as images. Clicking the image should do the same as clicking the link though, I made a JSFiddle to show what I mean (and to show the problem): the JSFiddle When I click the two links in there a new window is opened which has the site I want. But when I click the thumbnails I can't get a click on the link triggered. Clicking of the link will have extra functionality

CodeIgniter Anchor error: URL not found on this server

狂风中的少年 提交于 2019-12-02 02:45:27
I have been for hours to make a simple anchor link working without success. My controller is class Welcome extends CI_Controller { public function index() { $this->load->view('template'); } public function contact() { $this->load->view('contact'); } } My template.php view is basically a file with <a class="menuhref"> <?php echo anchor('welcome/contact/','Contato')?> </a> I also have a contact.php in the views directory. My config.php is $config['base_url'] = 'localhost'; $config['index_page'] = 'index.php'; When the template.php loads and I click in the link "contato" I would like to drive the