Getting the FULL url of an image, even with relative paths…

I was recently trying to get hold of a “full” image URL from the source of a page. I tried the following: ..and even using some JS code to try and work out if the image was a relative, absolute, or full URL… but that prooved very messy (and probably buggy). After some research I [...]

Posted in jQuery | Leave a comment

 

Convert HTML HEX code (#ffff00, etc) into RGB (255,255,0)

I recently needed to convert a HEX value in a database into a RBG (red-green-blue) value for using in some Javascript. I ended up doing it in the Perl code, as it worked out pretty simple: Then call with: This would convert the above into rgb(255,0,255) Enjoy! Andy I’ve been working as a Web-Design / [...]

Posted in Perl Coding | Leave a comment

 

Checking the validity of a “price” in Javascript

I recently needed to verify that someone entered a valid price for a field on one of my forms. I did a bit of looking around, and everything I found seemed a little over the top! Here is what I came up with: …simply call with: It will accept the format of: 1 10 10.99 [...]

Posted in jQuery | Leave a comment