User Profile

Collapse

Profile Sidebar

Collapse
akadeco
akadeco
Last Activity: Feb 25 '10, 11:03 AM
Joined: Aug 25 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • akadeco
    replied to Detect change of location.hash?
    you got the time and callback around the wrong way
    See more | Go to post

    Leave a comment:


  • On second keypress (within a specified time frame)

    Hi

    I've been wondering if there was a simple way to detect if a user presses the same character on the keyboard twice within one second. I've written some code that kind of works but it's unreliable.

    Code:
    var escapeCount = 0;
    
    function reset() {
    	escapeCount = 0;
    	setTimeout('reset();', 1000);
    }
    
    window.onload = function() {
      reset();
    };
    ...
    See more | Go to post

  • akadeco
    replied to Counting links in table rows
    Code:
    window.onload = function() {
    	var rows = document.getElementsByTagName('tr');
    	for (var i=0; i < rows.length; i++) {
    		var cells = rows[i].getElementsByTagName('td');
    		alert(cells[0].innerHTML);
    	}
    }
    Is what I was after

    Thanks
    See more | Go to post

    Leave a comment:


  • akadeco
    started a topic Counting links in table rows

    Counting links in table rows

    Hi

    I need to write a script that will allow me to check the value of any link in a table cell. The desired result would be something like this:
    Code:
    row[0].cell[2].innerHTML
    , allowing me to call the contents of the fourth cell in the first row.

    The following script may be of use as a starting point:

    Code:
    <table id="table">
    <tr>
    <td><a href="#">hello1</a></td>
    ...
    See more | Go to post

  • akadeco
    started a topic Removing subdomains from a string

    Removing subdomains from a string

    Hi

    Could anyone give me some pointers on how to remove subdomains from a string?

    For example:
    • If the string was bytes.com, it would stay bytes.com
    • If it was subdomain.bytes .com, it would become bytes.com
    • If it was subsubdomain.su bdomain.bytes.c om, it would become bytes.com


    Essentially, it just needs to strip off the subdomains and produce the root domain if not already present.

    Cheers...
    See more | Go to post

  • akadeco
    replied to How to delete unique items in an array
    @Kudos thank you so much that is exactly what I needed!

    Thank you all for your swift replies
    See more | Go to post

    Leave a comment:


  • akadeco
    started a topic How to delete unique items in an array

    How to delete unique items in an array

    Hi

    I need to write a program and part it's functionality is to delete unique items in an array. That is, delete items in the array that only occur once.

    I also need to delete the first occurrence of repeated items, and I'm pretty sure the solution to these two will go hand in hand.

    Thanks

    akadeco
    See more | Go to post
No activity results to display
Show More
Working...