- Sep 19, 2000
- 10,278
- 126
- 106
Some of the stuff that you can do with it are insane. For example, giving a class/element an attribute on the fly. Thats just insane. Or using a function pointer on a function with varying numbers of parameters. Its so loose in standards, no wonder people get driven nuts when they try to do something in C++ only to find "You can't do that."
Just saying. I got this revelation after hacking out this piece of code.
Feel free to share your "This language is nuts." stories here as well.
(Also, Ignore the indenting... It is somewhat a "work in progress")
Just saying. I got this revelation after hacking out this piece of code.
Code:
function ajaxUpdate(data)
{
this.nextSel.empty();
$(data).find('option').each(function ()
{
var ele = $(this);
var name = ele.attr('name');
var id = ele.attr('id');
var Opt = $('<option></option>');
Opt.text(id + ' - ' + name);
Opt.attr('value', id);
$('#exch').append(Opt);
});
}
$(document).ready(function (){
setupBrowser();
setupLayout();
setupAjax();
$('#comp').each(function() {
this.reqVal = 'ce';
this.nextSel = $('#exch');
});
$('#comp').change(function ()
{
$.ajax({
data: {
id: $(this).attr('value'),
// To do: replace with real cookie
sessionid: 'iifyqq1cg3kn',
request: this.reqVal
},
success: $.proxy(ajaxUpdate, this),
error: function()
{
}
});
});
});
Feel free to share your "This language is nuts." stories here as well.
(Also, Ignore the indenting... It is somewhat a "work in progress")