Something like this perhaps:
- window.NNA.dataMgr = window.NNA.dataMgr || (function() {
- var profile_cookie = {
- name: 'profileColor',
- options: {
- path: '/',
- expires: 365
- }
- };
- return {
- load: function(cookieName) {
- if($('.header-slideshow').length > 0){
- // Use parameter value in preference to internal name
- var value = $.cookie(cookieName || profile_cookie.name);
- // Do something with the cookie
- }
- }
- })();
- ;(function($){
- $.fn.dataProfile = function(opts) {
- function getLocation(){
- if($('.user-loc').length > 0){
- var geoLocation = NNA.dataMgr.load('newCookieName');
- }
- }
- }})(jQuery);
- $(document).ready(function () { $('#container').dataProfile(); });
getLocation is never called here.