Href for Javascript links: "#" or "javascript:void(0)"?
When building a link that has the sole purpose to run javascript, is it better to: <a href="#" onclick="myJsFunc();">Link</a> Or <a href="javascript:void(0)" onclick="myJsFunc();">Link</a> ...
When building a link that has the sole purpose to run javascript, is it better to: <a href="#" onclick="myJsFunc();">Link</a> Or <a href="javascript:void(0)" onclick="myJsFunc();">Link</a> ...
I changed the MembershipProvider in my ASP.net MVC website, and now the stylesheet for the login page isn't referenced correctly. Below is a copy of the forms tag in my web.config if that could be the reason. It looks identical though to the one generated by a new project with the exception of the name and timeout attribute. <authentica...
I have seen the following methods of putting javascript in an <a> tag: function DoSomething() { ... return false; } 1: <a href="javascript:;" onClick="return DoSomething();">link</a> 2: <a href="javascript:return DoSomething();">link</a> 3: <a href="javascript:void(0);" onClick="return DoSomething();">link</a> 4: <a href="#" onClick="re...
Hi, I have a slide show using javascript where images display from another server (remote server). i have to display images from another server,problem is when i set "src" property of "Img" html tag, it append my server localhost path at starting as "http:\mysitehost.com\myremoresite.com\image1.jpg" where my image path is "http:\myremote...
Hello, I'm writing a C# app using the WebBrowser control, and I want all content I display to come from embedded resources - not static local files, and not remote files. Setting the initial text of the control to an embedded HTML file works great with this code inspired by this post: browser.DocumentText=loadResourceText("myapp.index...
How can I go through all external links in a div with javascript, adding (or appending) a class and alt-text? I guess I need to fetch all objects inside the div element, then check if each object is a , and check if the href attributen starts with http(s):// (should then be an external link), then add content to the alt and class attrib...
I'm working on a wordpress template and need to add a hyperlink to the cartoon bubble at the top of the page. The bubble, as far as I can tell, is php. Where do I insert the href? <h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1> The href should point to www.ojaivalleynews.com The blog url is www.ovnblog....
Hi, I hope this question is not a RTFM one. I am trying to write a Python script that extracts links from a standard HTML webpage (the <link href... tags). I have searched the web for matching regexen and found many different patterns. Is there any agreed, standard regex to match links? Adam UPDATE: I am actually looking for two diffe...
Hi I want to refresh with ajax just a part of a site.I searched protorypjs and i found ajax.updater but i am having trobule making it work. this is part of my page <li id="Home"><a href="index.html">Home</a></li> Can anyone tell me how i can implement this : Ajax.Updater(container, url[, options]) ? and make it work? I linked prototyp...
Hello. Heads up: I am quite new to Javascript and have so far only written very basic scripts based on jQuery. I am a quick study though.. What I am after is a way to: 1) identify tags 2) read the img tags 3) wrap the tag with an <a href> tag with a dynamic link based on the src of the img. Example: <img src="../../img_T/Cultur...
Hello All, I just moved my Joomla! website from BradPPresents.com to BradP.com. No Nude, but MAY NOT BE SFW Everything works properly on unsecured HTTP access; But as soon as the site changes to HTTPS: the BASE HREF reverts to the OLD url "BradPPresents.com". I've changed every instance of BradPPresents.com I can find, with no success...
Queston: IE and Firefox / Safari seem to deal differently with BASE HREF and Javascript window.location type requests. First, is this an accurate description of the problem? What's going on? And what's the best cross-browser solution to deal with this situation? Context: I have a small PHP flat file sitelet (it's actually a usability ...
I'm having some major problems trying to get a "?" inside of hrefs that are part of my SVG scripts. I want to link to other parts of my website from inside of my SVGs, and most of my pages are dynamic that require $_GET variables to create them on the fly. SVG seems to throw a spaz every time I try to include question marks inside the hr...
Hi, On my website I use jQuery to hook the events of elements, namely hyperlinks. As these hyperlinks only perform actions on the current page, and do not lead anywhere, I have been putting a href attribute of "#" in: <a href="#">My Link</a> However in some browsers this causes the page to scroll right to top which is obviously undesi...
I'm working on sending out an html based email, and every time it sends the image src tags and some of the anchor href tags are modified to be relative url's. Update 2: This is happening between when the body of the email is generated and sent and when it arrives in my inbox. Update: I am using Postfix on a LAMPP server. In addition,...
can this code snippet be modified to reveal html coding? <?php $_option = $this->getOption() ?> <?php echo $this->htmlEscape($_option->getTitle()) ?> it is showing a title but in that title i have an href: <a href="http://link" target="otherwindow">link</a> instead of it appearing as a link it just shows me the code. i'd like it t...
Hi Guys Just wondering if anyone knows of a way that wiring up jquery to run a function for when a user clicks on a link or tabs to a link and hits enter. I want to intercept that activation of a link and perform an action before the page is changed, but I want to do it in either case. Cheers Anthony ...
I have a function that replaces anchors' href attribute in a string using Php's DOMDocument. Here's a snippet: $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadHTML($text); $anchors = $doc->getElementsByTagName('a'); foreach($anchors as $a) { $a->setAttribute('href', 'http://google.com'); } return $doc->saveHTML(); The ...
I have people posting their website address but variations are posted such as: theirsite.com www.theirsite.com http://theirsite.com http://www.theirsite.com When I link to an address without http:// it takes the link as internal <a href="theirsite.com">their site</a> sending people to something like: http://mysite.com/thiersite.co...
So I have this... $(this).attr("href", "http://site.com/images/downloads/wp-" + $(this).parent().parent().attr("id") + "-1024x768.jpg"); The problem is that when I Right Click > Save Link As... it doesn't link to the proper image. I'm not sure if its possible to do this or not, but I would really appreciate it if someone could help me...