Pure-Essence.Net

jQuery and Tamper data rock

Posted by: pureessence on: February 27, 2008

I’ve been working on a UI design at work and some of the build in components have border=”1″ on their generated table code. To achieve a consistent look, I always want border=”0″ on the table so I can control the table border with CSS. There is no way as far as I know you can get rid of the table border with CSS once the source have border=”1″ in the table tag. But you can get rid of all table borders with this single line of code in jQuery:

$("table[border!='0']").attr("border", "0");

It completely rules!!

While debugging, I also found this awesome Firefox plugin: Tamper data. It lets you hijack a post/get http request on the fly so you can view and modify the submitted parameters. I used to use WebScarab. But this is so much lighter weight. Although it only works in Firefox while WebScarab, a proxy server, would work with any browsers.

Advertisement

3 Responses to "jQuery and Tamper data rock"

I use this technique when I want to manipulate the html ( move stuff around, fix structure, etc. )

Just fire up firebug, use a jQuery bookmarklet, make changes Firebug w/ jQuery, then save the generated code when done.

You can also use Firebug to tamper w/ data, just select the form elements and change the values.

The same for mootools

$$('table').set('border', '0');

That is the long way of saying this:
$(“table”).attr(“border”, “0″);

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

My most adorable Pomeranians

Categories

Archives

SocialVibe


Follow

Get every new post delivered to your Inbox.