WPCAPI.generateCellURLThis is a featured page


String generateCellURL()
This method is overridable and should not be called directly.

This method generates a URL to be associated with a cell. By default, this method returns the current page URL with the cellId querystring parameter set to the new cell ID.

Parameters
StringparentIDThe identifier for the parent cell.Required
StringtitleThe title of the cell.Required
String []tagsThe keyword tags for the cell.Defaults to []
StringcellIDThe identifier for the cell.Required
Returns the URL to be associated with the cell.

Usage


Synchronous
if( window.WPCAPI ) {
WPCAPI.generateCellURL = function( parentID, title, tags, cellID ) {
return "/path/to/template/engine?cellId=" + cellID;
};
}

Asynchronous
if( window.WPCAPI ) {
WPCAPI.generateCellURL = function( parentID, title, tags, cellID ) {

var params = '?'
+ "parentID=" + encodeURIComponent(parentID)
+ "&title=" + encodeURIComponent(title)
+ "&tags=" + encodeURIComponent(tags)
+ "&cellID=" + encodeURIComponent(cellID);

var request = new XMLHttpRequest();
request.open( "GET", "/path/to/generateURL/action" + params,true );
request.onreadystatechange = function() {

if( request.readyState == 4 ) {
var response = request.responseXML; // Format: <cell url="..."/>
var url = response ? response.getAttribute("url") : null;
WPCAPI.generateCellURL_Callback(url);
}

};
request.send(null);

return null;

};

}



superwomyn
superwomyn
Latest page update: made by superwomyn , Oct 29 2008, 4:25 PM EDT (about this update About This Update superwomyn Changing overload to override. - superwomyn

1 word added
1 word deleted

view changes

- complete history)
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)