It's a work thing!
Home
Can I write plugins or do I just past in some js?
Trying to write a pbworks plugin in javascript. Not really a plugin, but just including a small amount of js in the page as that's all I've figured out how to do so far. Here's my snippet:
http://foo.com/json&callback=? returns a json object like{
callback: function( js ) {
/* some code here */
},
data: {
/* some data here */
}
}
all should be good, and is to a point. jquery does the getJSON, executes it, my code runs, but also displays lots of extra crap on the page likefunction C(Y, X) { var W = 0; try { this._each(function (a) {Y.call(X, a, W++);}); } catch (Z) { if (Z != $break) { throw Z; } } return this; }
function R(Z, Y, X) { var W = - Z, a = [], b = this.toArray(); if (Z < 1) { return b; } while ((W += Z) < b.length) { a.push(b.slice(W, W + Z)); } return a.collect(Y, X); }
function B(Y, X) { Y = Y || Prototype.K; var W = true; this.each(function (a, Z) {W = W && !!Y.call(X, a, Z);if (!W) {throw $break;}}); return W; }
I am cycling through an array in my own data, is all that extra crap appearing because prototype.js or scriptaculous (which pbworks uses) is extending the array prototype or something? Gah...
UPDATE: answered my own questions, changed somefor ( var i in js ) {
to somevar l = js.length;
for ( var i = 0; i < l; i ++ ) {
I'd still like to know if I can write a real pbworks plugin though.
pauly :: 2010 :: Comment / reply
Pauly - there are simply no words that could do justice to that post. You are a shoe-in for the blogging Pulitzer.
Dom :: 5 Mar :: 2010 :: Comment / reply
pbworks is an online collaboration site, a wiki really. I could go a lot more techie here, but I know it's really only you reading it, so I won't.
pauly :: 7 Mar :: 2010 :: Comment / reply
Over to you, discussion about anything local, but please be considerate... Folkestone on TV, Kent gigs, Find a flatmate, rent a room, property queries, current news, what's new, local events, for sale, local services, what I like about Folkestone, ask questions, offer advice, plug yourself... the more it's used the more useful a resource it will become. If you want a gig listed click here to add it (fixed now!), or just click here to post a message...
Also from the same week
Some more posts from the same week as .
Arial views of Westenhanger Castle [Thursday 4 March 2010]
Pictures from inside The Elizabethan [Wednesday 10 March 2010]

