phpfunk.com


Archive for the ‘javascript’ Category

download selenium 1.4.0 for firefox 8.0

Wednesday, November 9th, 2011

Firefox just updated itself and in the process made Selenium IDE plugin unusable. Apparently the Selenium IDE 1.3 plugin is not compatible with the latest version of Firefox, which I only upgraded to as it was described as a “security update”. Have no fear, there is a new release of Selenium IDE out that is [...]

make selenium ide pause

Monday, May 16th, 2011

Selenium IDE is a great integration testing tool. It has a built in function pause(msec) where msec is the number of milliseconds you want Selenium to pause for. In my situation Selenium does not pause (IceWeasel version 3.5.16, Selenium IDE 1.0.10). I tried pause(3000) and it did not seem to work. I tried pause(30000) and [...]

learn jquery in five minutes

Thursday, March 11th, 2010

I am switching from prototype to jquery as a javascript library. So far so good. Here’s how you do the basic tasks you need to do: Selecting an element by id having the id “fubar”…doing this you get a jquery object and get use all the methods and attributes thereof: var elem = $(‘#fubar’); Create [...]

object oriented javascript: inheritance

Thursday, March 11th, 2010

Here’s the short explanation of how to do inheritance with javascript. This was the best site I found on the subject and I tell the same story albeit tersely. I defined a base class, called Base just to be clear: Base = function() { } Base.prototype.say = function(foo) { return foo; } Then I defined [...]

using this in javascript method bodies

Tuesday, February 9th, 2010

This is a clear reference on the subject.

traversing xml with javascript

Tuesday, February 9th, 2010

Here are some excellent references on walking thru a XML blob with javascript. I was a little rusty. The main issue was that every element has a child node that is a text node, even if that text is empty. I was laboring under the misconception that somehow the text portion of an element was [...]

example text area with javascript character counter

Saturday, February 6th, 2010

If you plan on only accepting a fixed number of characters from a textarea, its probably a good idea to tell the user how many they have left. This examples demostrates using javascript to count the number of characters entered in a textarea. Actually, you can use this to figure out how many characters where [...]

prototype ajax examples

Saturday, February 6th, 2010

These examples use the prototype library. View the HTML source to see my javascript functions. Refer to the prototype API for examples and explanations of Ajax, etc. Example One Here we submit a form in an ajax way. The onsubmit is used to send the request and get the response and update the div. The [...]