Regex methods for grabbing HTML Classes





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

« Previous 1 2  ...  7 8 9 10 11 12 13 14 15 Next »
7
Date Submitted Sat. May. 12th, 2007 10:38 AM
Revision 1
Helper albud
Tags colour | JavaScript | palette | web-safe
Comments 1 comments
A websafe colour palette generator in JavaScript. Coded this after looking at http://www.bytemycode.com/snippets/snippet/585/ and wanting to do it differently.

It's been refactored so that:
* can pass generateColourPalette an arbitrary array of colour codes and it'll generate a palette.
* it hooks into the page through the external file
* uses an internal stylesheet instead of inline styles
10
Date Submitted Mon. Jun. 4th, 2007 2:37 PM
Revision 1
Scripter Fordiman
Tags createElement | JavaScript | kiss
Comments 1 comments
This is a function I created to ease headaches caused by creating and inserting new stuff in an HTML document dynamically. Essentially, it allows you to specify an HTML tag, in its entirety (attributes, styles, event handling, etc), via a single command. You can nest it, so as to create an entire element tree programmatically in a lot less time as with document.createElement.

Don't let the goofy function acronym fool you; this is damned powerful.

First, the function spec:
HTMLElement acne(type[,attributes[,styles[,events[,children[,parent[,document]]]]]]);

Arguments:
String type: type of element to create; same information as the argument of document.createElement
mixed Object attributes: attributes you want the new element to have (ie: href, src)
mixed Object styles: styles for the new element (ie: width, borderLeft)
(function|function Array) Object events: event handlers for the new element
HTMLElement|HTMLElement Array children: elements you want to be in the new element (ie: nesting is possible)
HTMLElement parent: parent node of object
HTMLDocument document: document to create element in

Return value: The newly created/configured element
6
Date Submitted Mon. Jun. 4th, 2007 3:06 PM
Revision 1
Scripter Fordiman
Tags "object passing" | JavaScript | PHP | serialize
Comments 6 comments
This is a quick set of overrides for Javascript so that any variable can be passed to PHP in a GET/POST activity. Just call myVar.toPHP();

I use this little set of functions extensively in a little Javascript/PHP RPC handler I wrote. I don't have the reverse function, as I pass JSON back to the browser for the return value.

Note: This lib is not safe for binaries or HTML Elements. The former will come out similar to FTP ASCII breaks, and the latter will cause infinite recursion. If you want to make a speical case for HTML Elements, do so; you could probably just test for parentNode and create a 'safe' object from that. I didn't need it, so I didn't code it.

As for binary safety, at some point between toPHP/escape/post/urldecode/unserialize, the object breaks. Rather than create a huge fix for something I didn't need to do, I put in a quick match/hack. Don't like it? Write the fix yourself.
7
Date Submitted Fri. Jul. 20th, 2007 11:12 PM
Revision 1
Helper lavaramano
Tags Array | getelementsby | JavaScript
Comments 1 comments
Returns an array with all the objects with certain class. tested on IE 6 and Firefox 2
6
Date Submitted Fri. Jul. 20th, 2007 11:17 PM
Revision 1
Helper lavaramano
Tags DOM | JavaScript | Key | onkeyup
Comments 0 comments
Returns the keycode of the key we wrote on a textarea/input. works on IE and Firefox
6
Date Submitted Fri. Jul. 20th, 2007 11:42 PM
Revision 1
Helper lavaramano
Tags DOM | JavaScript | mouse | onclick | pointer
Comments 1 comments
it give us the position of the mouse. works on IE and Firefox

use:
onclick="posicion_mouse(event)"
5
Date Submitted Tue. Sep. 4th, 2007 3:05 PM
Revision 1
Helper explode
Tags Class | mysql | PHP
Comments 0 comments
This is my MySQL database class that I use for all of my sites. Some included features are:
- Get execution time
- Error reporting (screen and email)
- SQL stats
5
Date Submitted Tue. Sep. 4th, 2007 4:51 PM
Revision 1
Helper explode
Tags Class | error | PHP
Comments 1 comments
A very simple error class that can be pretty handy.
4
Date Submitted Tue. Sep. 4th, 2007 5:21 PM
Revision 1
Helper explode
Tags "credit card" | Class | PHP
Comments 0 comments
This is a simple credit card validation class that you can check for most issues before you process you form through paypal, authorize.net, or anywhere else. This also uses my Simple Error Class, the error class is required for this.
5
Date Submitted Tue. Sep. 4th, 2007 11:13 PM
Revision 1
Helper explode
Tags "credit card" | authorize.net | Class | PHP
Comments 0 comments
This is an authorize.net credit card processing class. Required elements are:
- Authorize.net account (live and/or sandbox)
- PHP w/ CURL installed
- SSL certificate installed on server
- My Simple Error Class

And use my Easy Credit Card Class as a pre-processor to this class.

For more information on authorize.net just go to their website and download their developers information.
« Previous 1 2  ...  7 8 9 10 11 12 13 14 15 Next »