[Pro] kangax's version of a Quick Filter

Hi,

I think I need some help with code. I have used this simple search that Walter provided on this page for some time, but it suddenly quit working. Aside from some background colors and additional items / photos (well, several actually) I don’t know what has changed.

I have copied the script from a backup (when working - less stuff ) but no avail. I did add a page-back arrow with some CSS effects that I would like to keep if there is work around, but that doesn’t fix the issue when removed.

This is the page:

http://www.class-e-ads.com/listings.html

and this is the code applied to Proct proto - packed :

//kangax’s version of the quick filter

var list = $$("#ItemsTable tr").reject(function(elm){ return elm.down('th'); });
list.each(function(elm){
	elm['keys'] = elm.innerHTML.stripTags().toLowerCase();
});
var lastValue = $F("filter");
$('filter').observe('keyup', function(e) {
	var value = this.value.toLowerCase();
	if (value !== lastValue) {
		list.each(function(elm) {
			if (elm.keys.include(value)) {
				elm.show();
			}else{
				elm.hide();
			}
		})
		lastValue = value;
	}
});
$('filter').observe('click', function(e) {
	var value = this.value.toLowerCase();
	if (value == '') {
		list.invoke('show');
		lastValue = '';
	}
});

Thanks in advance for any and all help!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I just remembered - I was following the thread about CloudFlare and decided to try it. Think that may have something to do with it - I don’t know ‘code’ but I would think that is preliminary to that script.

Frank H.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Corrections:

Just remembered - I was following the thread about CloudFlare and decided to try it. Think that may have something to do with it ? - I don’t know ‘code’ but I would think that is preliminary to the above script.

Frank H.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One of CloudFlare’s many tricks is that it compresses all of your JavaScript before they cache the page. You’re going to have to go through all of the code and make sure that every line ends with a semicolon or a brace, because compression algorithms usually just mash everything into a single line, and without a proper line-ending, this will wail.

Walter

On Dec 3, 2011, at 7:25 PM, Frank H wrote:

Corrections:

Just remembered - I was following the thread about CloudFlare and decided to try it. Think that may have something to do with it ? - I don’t know ‘code’ but I would think that is preliminary to the above script.

Frank H.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The contents of these table rows don’t appear to be raw HTML, entered manually or through Freeway, but rather products of a document.write operation from another script. Kangax’s filter isn’t going to help you here. If you try this again, on a normal table that you drew with Freeway’s table tool and populated with text that you typed into each cell, you will find that it works. You don’t have any obvious typos in your script as far as my recovering eyes can see.

Walter

On Dec 3, 2011, at 7:15 PM, Frank H wrote:

Hi,

I think I need some help with code. I have used this simple search that Walter provided on this page for some time, but it suddenly quit working. Aside from some background colors and additional items / photos (well, several actually) I don’t know what has changed.

I have copied the script from a backup (when working - less stuff ) but no avail. I did add a page-back arrow with some CSS effects that I would like to keep if there is work around, but that doesn’t fix the issue when removed.

This is the page:

http://www.class-e-ads.com/listings.html


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ahh,

Thank you Walter.
Good to hear from you buy the way, you must be (hoping) well on the mend.

Frank H.
On Dec 4, 2011, at 8:09 AM, Walter Lee Davis wrote:

One of CloudFlare’s many tricks is that it compresses all of your JavaScript before they cache the page. You’re going to have to go through all of the code and make sure that every line ends with a semicolon or a brace, because compression algorithms usually just mash everything into a single line, and without a proper line-ending, this will wail.

Walter

On Dec 3, 2011, at 7:25 PM, Frank H wrote:

Corrections:

Just remembered - I was following the thread about CloudFlare and decided to try it. Think that may have something to do with it ? - I don’t know ‘code’ but I would think that is preliminary to the above script.

Frank H.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you again Walter.
I don’t know where that would have changed. I even started out with the soldiers table, then I realized how the code was applied,
perhaps in the multiple additions of rows or some corrections along the way, I have even copied it from backups when damaged previously. I should be looking into some other means of data bases anyway.

Again, thanks.
Frank H.

On Dec 4, 2011, at 10:37 AM, Walter Lee Davis wrote:

The contents of these table rows don’t appear to be raw HTML, entered manually or through Freeway, but rather products of a document.write operation from another script. Kangax’s filter isn’t going to help you here. If you try this again, on a normal table that you drew with Freeway’s table tool and populated with text that you typed into each cell, you will find that it works. You don’t have any obvious typos in your script as far as my recovering eyes can see.

Walter

On Dec 3, 2011, at 7:15 PM, Frank H wrote:

Hi,

I think I need some help with code. I have used this simple search that Walter provided on this page for some time, but it suddenly quit working. Aside from some background colors and additional items / photos (well, several actually) I don’t know what has changed.

I have copied the script from a backup (when working - less stuff ) but no avail. I did add a page-back arrow with some CSS effects that I would like to keep if there is work around, but that doesn’t fix the issue when removed.

This is the page:

http://www.class-e-ads.com/listings.html


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

One thing you might try is this. Cut all of the code out of the top Function Body button, and paste it into the bottom Function Body button. See if that makes any difference. The actual difference between the two editors is timing. The first one fires when the DOM is stable – all the HTML that’s going to load is loaded into the browser’s memory. But any scripts that wait on the page load to fire will not have fired yet. In your case, this means the data table isn’t there in the browser’s memory yet. Now if your data table loads after the page if completely loaded, then this suggestion will not work. But if your data table loads in at the same instant as the top function body editor, then this will help you out.

I do recommend that you find a different database solution in any case, because what you’re doing is entirely opaque to Google. document.write() is invisible to any user-agent that doesn’t run JavaScript.

And thanks, my vision is improving by leaps and bounds.

Walter

On Dec 4, 2011, at 1:56 PM, Frank H wrote:

I don’t know where that would have changed. I even started out with the soldiers table, then I realized how the code was applied,
perhaps in the multiple additions of rows or some corrections along the way, I have even copied it from backups when damaged previously. I should be looking into some other means of data bases anyway.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options