This one was tricky. Clearing a select with a unique id using $(‘#mySelectId’).val(”), $(‘#mySelectId’).selected(”), or $(‘#mySelectId’).reset() will fail/break. Even setting the selectedIndex to -1 won’t work…
Unless you specify the first object in the array of objects with that unique id (even if there is only one). Example:
$('#mySelectId')[0].selectedIndex = -1
0 notes
javascript
forms
jquery
code
Create array with lines of plain text from a textarea.
0 notes
javascript
code
// *hiyah* ninja!
to the end of my best lines of jQuery?
0 notes
jquery
ninja
javascript
code

It’s more than just Javascript/HTML/CSS enabled extensions. Check out the demos. Looks very powerful. I wish Safari had an answer for this…
0 notes
mozilla
firefox
javascript
jetpack
extensions
Requires jQuery, and a some HTML.
function getTwitter(sn) {
var url = "http://twitter.com/status/user_timeline/"+sn+".json?count=1&callback=?";
$.getJSON(url, function(data){
$.each(data, function(i, item) {
var image = item.user["profile_image_url"];
var text = item["text"];
//changes the image size to 73x73px
image = image.replace(/normal/, "bigger");
});
});
//puts the image src in an existing img id=+sn+img
$("img#"+sn+"img").attr("src", image);
//puts the latest tweet in an existing span id=+sn+tweet
$("span#"+sn+"tweet").text(text);
}
//do it
getTwitter("tbeseda");
This is mostly to test syntax highlighting on tumblr, but I thought I’d share some code anyway.
0 notes
Twitter
jquery
javascript
code
json
tumblr