Trimming web page content with jQuery —19 August 2014
I had just one small bu very annoying problem: the site has no easy way to filter experts, the best way to search for an expertise is a browser’s page search function. Unfortunately the page is long, and although the experts are grouped by city, it’s hard to tell if a match I’m looking at is in the section of the city I’m looking for.
jQuery to the rescue!
Looking at the HTML source,
the page includes jQuery,
When inspecting a couple of baggers,
I found that each of them has
id ending with the name of their city,
If I can remove the baggers from other cities,
the page will be easier to search,
with fewer or no false positives.
After a couple of failed tests where I deleted the wrong (or all) baggers by mistake, forcing me to reload the entire (and very slow loading) page, I arrived at a safer and easier method:
- Step 1: hide all the
- Step 2: show the baggers with id ending with the city I need