User Profile
Collapse
-
you got the time and callback around the wrong way -
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(); }; -
Is what I was afterCode: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); } }
ThanksLeave a comment:
-
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:, allowing me to call the contents of the fourth cell in the first row.Code:row[0].cell[2].innerHTML
The following script may be of use as a starting point:
...Code:<table id="table"> <tr> <td><a href="#">hello1</a></td>
-
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... -
@Kudos thank you so much that is exactly what I needed!
Thank you all for your swift repliesLeave a comment:
-
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
No activity results to display
Show More
Leave a comment: