From the course: jQuery: Creating Plugins
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Challenge: An AJAX-enabled ads plugin - jQuery Tutorial
From the course: jQuery: Creating Plugins
Challenge: An AJAX-enabled ads plugin
- Now it's time for a small challenge. Open the index.html file in the start folder of Chapter 3, video 7. You're gonna wanna open this example in Safari if you're on a Mac, or in Internet Explorer on Windows, if you're just opening it straight out of the Exercise Files. We'll go over why in a minute. Let's see what's happening here. This is a page from the Bright Ideas blog, with a scintillating first post. Then, over here in the sidebar is the area that we're gonna pay attention to, the Our Partners area with a couple of ads. It's not uncommon to have a suite of ads that you'd like to pull in and randomize. We have a plugin that's gonna do that. Let's take a look at the code. Here I am in that index.html file, and the plugin is not yet running. Let me uncomment this line and switch back. Now if I reload, I start to see a different selection of ads every time. This will only work in Safari, or Internet Explorer on Windows, because we're using AJAX to pull these files in, and those…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Writing the code: Always the first step3m 34s
-
Converting the code into a plugin4m 22s
-
Making the plugin configurable with options7m 39s
-
Determining and adding appearance options3m 50s
-
Grouping related options for better usability4m 25s
-
Protecting your plugin by validating user input5m 54s
-
Challenge: An AJAX-enabled ads plugin4m 59s
-
Solution: An AJAX-enabled ads plugin3m 44s
-
-
-