Join Joe Marini for an in-depth discussion in this video Solution, part of jQuery Essential Training.
(lighthearted tone)…- [Narrator] For my solution, I used the wrap function,…that we say earlier in the course,…to create a new link tag around each of the images…in the product section.…So, let's walk through the code…and I'll explain how I did this.…First, remember that part of the challenge…was that we needed to pass two query string parameters…to to product.html page.…The first was the product name,…and the second was the product ID.…So, my code starts by using a selector expression…to get all of the list item tags that contain each product.…
I then use the children function…to get the h2 tag inside the list item…and then call the text function on that h2…to get the product name.…Since this string is going to be passed as part of a URL,…I need to call the browser's encodeURIcomponent function…to convert any characters that aren't…allowed to appear in URLs.…For the product ID, I just need to get the value of…the data attribute that is on the list item tag itself.…
And then again, I need to make sure…that it is encoded properly because…
- What is jQuery?
- Using selectors and filters to extract information
- Creating, inserting, and animating page content
- Handling events
- Understanding jQuery statement chaining
- Working with CSS
- Building event handlers
- Animating with jQuery: showing, hiding, and fading page elements
- Working with AJAX
Skill Level Beginner
1. A Quick Introduction to jQuery
2. Working with Page Content
3. Manipulating Page Content
4. jQuery Events
5. Animations and Effects
6. AJAX Operations
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.