HTML and CSS Reference
In-Depth Information
iFramePubjQuery: window.parent.jQuery,
googjQuery: " " + latestVersion + "/jquery.min.js",
for (var libs in libraries) {
var lib = libraries[libs];
console.log("Possible Libs: " + lib);
if (libraries.pubjQuery || libraries.iFramePubjQuery) {
console.log("Publisher Has jQuery - We're Good!");
} else {
function loadScript(_script) {
var script = document.createElement("script")
script.type = "text/javascript";
script.defer = true;
script.src = _script;
console.log("We choose " + _script);
This conditional can be used in the ad to detect whether the page has jQuery included. If it doesn't, the ad server
can bring it in before the ad loads because it could be dependent on it. Another good recommendation in using jQuery
is pulling it from Google's CDN. This will more than likely already be cached on the user's machine (everybody uses
Google); so no additional downloading will be required. This is a huge optimization technique—and why do more
than you have to, right?
Since there is a good chance some if not all of your publishers will be leveraging jQuery, be sure to ask if they
have modified versions of the library loaded before using them within the ad experience. There is a really good chance
that a publisher could be loading jQuery version 1.8.2 but in fact it's a variation of that library. This fact alone could
steer many ad developers away from using the library from the publisher.
In web development and content creation, jQuery is great. It's relatively lightweight when compressed and
minified for its feature set. It has a huge developer following that constantly supports the code base, and it's even
backed by major companies like Adobe and Google. That said, in advertising it can produce unnecessary code
bloat and heavy load times if it's not fully needed. Rapidly developed JavaScript libraries can be a huge advantage,
especially if you're just trying to prototype something to test functionality. However, bear in mind that keeping code
minimal and lean makes for faster code execution and better performance, especially on mobile devices.
Some very popular JavaScript libraries, listed in Table 3-1 , provide useful features for handling variances across
browsers and dealing with such specific features as touch events, video, canvas , and offline storage. There'll be more
on some of these libraries in later chapters.
Search WWH ::

Custom Search