Posts Tagged ‘Web Server’

Advanced Scriplaculous Sortable Demo Fix

Monday, April 20th, 2009

Heh.

There is a good example of using nested Scriplaculous Sortables. With one little flaw – Scriplaculous ver 1.6.x is used, and when you try to execute the code with newer version of library – sections.each is not a function error pops up.

Here is the way to fix it – you’ll probably need it if you want to save the results :-D

Just replace “document.getElementsByClassName(‘section’);” to “$$(‘.section’);”

Before

function getGroupOrder() {
	var sections = document.getElementsByClassName('section');
	var alerttext = '';
	sections.each(function(section) {
		var sectionID = section.id;
		var order = Sortable.serialize(sectionID);
		alerttext += sectionID + ': ' + Sortable.sequence(section) + '\n';
	});
	alert(alerttext);
	return false;
}

After

function getGroupOrder() {
	var sections = $$('.section');
	var alerttext = '';
	sections.each(function(section) {
		var sectionID = section.id;
		var order = Sortable.serialize(sectionID);
		alerttext += sectionID + ': ' + Sortable.sequence(section) + '\n';
	});
	alert(alerttext);
	return false;
}

Then modify it for your needs and go on )

What was that?
Quote:

As of Prototype 1.6, document.getElementsByClassName has been deprecated since native implementations return a NodeList rather than an Array.

Popularity: 31% [?]

404 in logs

Friday, July 20th, 2007

I hate 404s. I use awstats to watch my logs, and I hate when it shows some 404s…

I can tolerate some virus-generated URLs but when I see this “/feed%3Ahttp%3A//eyedmax.com/feed/“or search bot asking me for robots.txt or favicon.ico (and I haven’t one) – I can blow up.

My advices to all webmasters are following:

  • put all common files (including index.html, robots.txt and favicon.ico) to your site
  • validate the code for “strange” URLs
  • analyze log files
  • use the automatically generated site map

Don’t trouble Google ’till Google troubles you!

Popularity: 16% [?]


Switch to our mobile site