The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?    function myJsFunc() {     alert("myJsFunc"); }...
What is the difference between window.location.href and window.open () methods in JavaScript?...
In the 1990s, there was a fashion to put Javascript code directly into <a> href attributes, like this:  <a href="javascript:alert('Hello world!')">Press me!</a>   And then suddenly I stopped to see it. They were al...
I have an anchor with both HREF and ONCLICK attributes set. If clicked and Javascript is enabled, I want it to only execute ONCLICK and ignore HREF. Likewise, if Javascript is disabled or unsupported, I want it to follow the HREF URL and ignore ONC...
I am trying to write a GreaseMonkey script in which I want to find all of the links that are relative links.  It seemed to me that the way to do that would be to match the contents of href against /^https?:///.  But I find that when I access the an...
I have a question that will be found very often. The problem is that nowhere can be found an explicit solution.  I have two problems regarding anchors.  The main goal should be to get a nice clean url without any hashes in it while using anchors to...
I have a page where I don't want the outbound links to send a referrer so the destination site doesn't know where they came from.  I'm guessing this isn't possible but I just want to make sure there weren't any hidden javascript m...
What's the fastest method to detect if foo='http://john.doe' is an external url (in comparsion to window.location.href)?...
I've got the script below  var els = document.getElementsByTagName("a"); for(var i = 0, l = els.length; i < l; i++) {   var el = els[i];   el.innerHTML = el.innerHTML.replace(/link1/gi, 'dead link'); }   However this searches t...
I would like to know what is the difference between javascript:; and javascript:void(0); if I use them in href attribure for a anchor (link)  <a href="javascript:;" onclick="DoSomething();">Link</a>  <a href="javasc...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.