Javascript: Online JSON Formatter & Java JSON Serialization
Sunday, March 7th, 2010Online Formatter
http://jsonformatter.curiousconcept.com/
http://jsonformatter.curiousconcept.com/
Assuming the iframe is from the same domain that the top window, use frameElement.ownerDocument to get to the parent document.
var topWindowHref = window.frameElement.ownerDocument.location.href
From John Resig Javascript array remove
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
Examples:
// Remove the second item from the array array.remove(1); // Remove the second-to-last item from the array array.remove(-2); // Remove the second and third items from the array array.remove(1,2); // Remove the last and second-to-last items from the array array.remove(-2,-1);
var tweeturl = "http://search.twitter.com/search.json?count=2&q=HAITI&callback=?";
$.getJSON(tweeturl, function(data){
$.each(data.results, function(i, item) {
$('<p></p>')
.addClass(i%2 ? 'even' : 'odd')
.html(item.text)
.prepend("<img src='" + item.profile_image_url + "' />")
.appendTo('#testDiv');
});
});
Result:
{
"results":[
{
"profile_image_url":"http://a1.twimg.com/profile_images/339499068/LaCroixLogoBlu2_normal.jpg",
"created_at":"Mon, 08 Mar 2010 02:16:46 +0000",
"from_user":"LaCroixChurch",
"to_user_id":null,
"text":"Geaux Haiti! "Far Away" by Lecrae... Powerful song for a honorable cause. Keep praying for Haiti brothers and... http://bit.ly/bbc7Za",
"id":10148624077,
"from_user_id":31526514,
"geo":null,
"iso_language_code":"en",
"source":"<a href="http://www.facebook.com/twitter" rel="nofollow">Facebook</a>"
},
.....
Feel free too add new one as comment I will update this page
Here are some JQuery puglins for creating Modal Dialog Box:
Add the djConfig to the script tag.
For complete list of variables check out the dojo/_base/_loader/bootstrap.js file.
Click here to see the one in trunk.