This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert( "hello world" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "YourViewController.h" | |
#import <QuartzCore/QuartzCore.h> //required to achieve corner radius | |
//.....Setup your controller... | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
//add a corner radius to the UILabel | |
self.label.layer.cornerRadius = 8; | |
} | |
//....the rest of your controller code goes here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query_string = ''; | |
$("someElement").each( function() { | |
if (this.checked) { | |
query_string += "&test[]=" + this.value; | |
} | |
}); | |
$.ajax({ | |
type: 'POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputArray = []; | |
$('#listOfData').each( function(){ | |
inputArray.push( this.value ); | |
}); | |
$.post( 'yourServerPage.php', { | |
'data[]': inputArray | |
}, function( outputData ){ | |
$('#outputDiv').empty().append( outputData ); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.get( "yourServerPage.php", { | |
'data[]': inputArray | |
}, function( outputData ){ | |
$("#outputDiv") | |
.empty() | |
.append( outputData ); | |
}); | |
$("#outputDiv").load( "yourServerPage.php", { | |
'data[]': inputArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
//set up your widget | |
dojo.declare("MyTable", dijit._Widget, { | |
//other widget method declarations | |
buildRows: function(){ | |
dojo.forEach(users, dojo.hitch(this, function(user){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
//set up your widget | |
dojo.declare("MyTable", dijit._Widget, { | |
constructor: function(args){ | |
//other stuff to instantiate | |
this._childWidgets = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//================== | |
// Track a widget | |
//================== | |
var actionButtons = new ActionButtons(); //ActionButtons now needs to be destroyed!! | |
this._childWidgets.push(actionButtons); | |
//================== | |
// Track an event handler | |
//================== | |
var handle = dojo.connect( /*your params*/ ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
//set up your widget | |
dojo.declare("MyTable", dijit._Widget, { | |
//initiation methods for your widget | |
destroy: function(){ | |
//destroy your child widgets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateTheWidget(){ | |
var newData = getData() // handles the xhr request to retrieve the new set of data | |
theWidget.attr("data", newData); //update the widget with the new set of data | |
theWidget.refresh(); //refresh the widget UI | |
} |
OlderNewer