Jump to content

jQuery: selecter not defined


chiprivers

Recommended Posts

Hi, I am relatively new to javascript and an even newer user of jQuery, so please excuse me if I am missing something really simple here.

 

I have the following jQuery script in my page:

$('.status')
			.click( function(e) {

				var clicked = $(this).attr('id');
				clicked = clicked.split('_');
				var click_ff = clicked[1];
				var click_start = clicked[2];
				var click_end = clicked[3];
				var res = $('#su_res').val();

				if ($('#su_ff').val() == "") { // if there is no existing selection
					// set form values
					$('#su_ff').val(click_ff);
					$('#su_start').val(click_start);
					$('#su_end').val(click_end);
					console.log('happy thus far!');
				} else if ($('#su_end').val() - $('#su_start').val() != res - 1 || click_ff != $('#su_ff').val()) { // if there is more than one cell selected or different ff clicked
					// clear previously selected range
					var shade_start = $('#su_start').val();
					while (shade_start < $('#su_end').val()) {
						var shade_end = shade_start + res - 1;
						$('#_'+$('#su_ff').val()+'_'+shade_start+'_'+shade_end).removeClass('selected');
						shade_start += res;						
					}
					// set form values
					$('#su_ff').val(click_ff);
					$('#su_start').val(click_start);
					$('#su_end').val(click_end);					
				} else {
					if (click_start < $('#su_start').val()) {
					// set new start value
					$('#su_start').val(click_start);
					}
					if (click_end > $('#su_end').val()) {
					// set new end value
					$('#su_end').val(click_end);
					}				
				}
				// shade selected range
				var shade_start = $('#su_start').val();
				while (shade_start < $('#su_end').val()) {
					var shade_end = shade_start + res - 1;
					$('#_'+$('#su_ff').val()+'_'+shade_start+'_'+shade_end).addClass('selected');
					shade_start += res;						
				}
			});

 

Firebug is reporting that 'selecter is not defined', but I don't know what this means or where my error is!  Can anyone help?

 

If you need any explanation as to what I am trying to do with this script, please let me know.

 

Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.