Shaare your links...
3325 links
L!NKS Retour au blog Login RSS Feed ATOM Feed Tag cloud Picture wall Daily
Links per page: 20 50 100
page 1 / 1
1 results for tags unobstrusive x
  • How To Use A Link To Call Javascript? - Stack Overflow
    <html>
    <head>
       <script type="text/javascript">

           // Wait for the page to load first
           window.onload = function() {

             //Get a reference to the link on the page
             // with an id of "mylink"
             var a = document.getElementById("mylink");

             //Set code to run when the link is clicked
             // by assigning a function to "onclick"
             a.onclick = function() {

               // Your code here...

               //If you don't want the link to actually
               // redirect the browser to another page,
               // "google.com" in our example here, then
               // return false at the end of this block.
               // Note that this also prevents event bubbling,
               // which is probably what we want here, but won't
               // always be the case.
               return false;
             }
           }
       </script>
    </head>
    <body>
       <a id="mylink" href="http://www.google.com">linky</a>;        
    </body>
    </html>
    permalink -
    - http://stackoverflow.com/questions/688196/how-to-use-a-link-to-call-javascript
    javascript unobstrusive
Links per page: 20 50 100
page 1 / 1
Shaarli 0.0.41 beta - The personal, minimalist, super-fast, no-database delicious clone. By sebsauvage.net. Theme by idleman.fr.