Jump to content

Archived

This topic is now archived and is closed to further replies.

mogulskier9

Javascript Cache?

Recommended Posts

mogulskier9

Is there some sort of pagelines dms javascript cache? My custom javascript in pagelines hasn't been updating for the last 2 days now. It shows properly when logged in, but when logged out the changes aren't coming through. There aren't any caching plugins installed either.

Share this post


Link to post
Share on other sites
Danny

HI,

 

There is no JS cache in DMS, therefore the issue is likely caused by your script itself. Can you provide a link to the site in question please.

 

Also, what is the code you're using and where have you added it ? What doe the code do ?

Please be aware that we do not provide support for third party code issues.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
mogulskier9

Yeah, take a look at the javascript outputted at http://krassandco.com/

 

Here's what should be there. Two days ago it just stopped updating if you're logged out. If I add the rest of the script via a plugin (which I now have) it works with no errors, so I don't think it's an issue with the code:

 

<script type="text/javascript">
jQuery( document ).ready(function( $ ) {
 
  // FUNCTION for when the page reloads with new sizes/colors
    var bindReload = function () {
      $('.widget.widget_layered_nav').find('.widgettitle').next().css('display','none');
      $('.widget.widget_layered_nav').find('.widgettitle').click(function () {
        $(this).find('ul.show-count').css('display','block');
        $(this).next().toggle();
 
      });
      
      $( "section#products ul.products" ).wrap( "<div class='woocommerce columns-3'></div>" );
      $('.product-thumb-wrap img').each(function() {
        $img = $(this).attr('data-lazy-src');
        $(this).attr('src',$img);
      });
    }
    
    //The event is written dumb, and so you have to wait for DOM render time
    $('body').on('aln_reloaded', function () { setTimeout(bindReload, 250); });
    bindReload();
  
  $('li.cat-item-54 ul').hide();
  $('section.footer-section br').remove();
  $('div.editor-row').addClass('row-closed');
  $('.row.grid-row').addClass('row-closed');
  if ( $("body").is(".term-men") ) {
        $('ul.product-categories li').hide();
        $('li.current-cat').show();
        $('li.current-cat > a').hide();
        $('li.current-cat > span').hide();
        $('li.current-cat > ul').show().children().show();
    } else if ( $("body").is(".term-women") ) {
        $('ul.product-categories li').hide();
        $('li.current-cat').show();
        $('li.current-cat > a').hide();
        $('li.current-cat > span').hide();
        $('li.current-cat > ul').show().children().show();
    } else {
      $('ul.product-categories').css({"margin-left":"15px"}); 
    }
    $( "section#products ul.products" ).wrap( "<div class='woocommerce columns-3'></div>" );
    $('li.widget_layered_nav ul').hide();
$('li.widget_layered_nav h2.widgettitle').click(function(){
$(this).parent().find('ul').show().children().show();
        $(this).addClass('show');
});
$('li.widget_layered_nav h2.show').click(function(){
$(this).parent().find('ul').hide().children().hide();
        $(this).parent().removeClass('hide');
});
  $('h2.wc-nested-category-layout-category-title').each(function() {
$cat_name = $(this).find('a').text();
$(this).html($cat_name);
});
  var $maxitems = 0;
$("li.widget_layered_nav ul.sizes small.count").each(function() {
   var n = $(this).text();
   if(n > $maxitems){
    $maxitems = n;
   }
});
 
// Product Selector
  $('h2.widgettitle:contains("All Sizes")').html('All Sizes ('+$maxitems+') ▼');
  $('h2.widgettitle:contains("All Colors")').html('All Sizes ('+$maxitems+') ▼');
 
  // Scrolling Header
  $('div.page-canvas').prepend('<div class="header-buffer" style="position: relative; height: 135px;"></div>');
    $('header.header').css({"position":"absolute","top":"0","left":"0","right":"0"});
    $(window).scroll(function() {    
   var moveit = $('#header'),
        targetScroll = '100',
        currentScroll = $(document).scrollTop();
        moveit.toggleClass('scroll-header', currentScroll >= targetScroll);
});
 
// Modify header for mobile
$(window).resize(function(){
      if ($(window).width() <= 784){
$('#socialinksu6o7x7s').prependTo('#navbaru421e6 div.navbar-content-pad');
$('#socialinksu6o7x7s').css({"float":"left"});
        } else {
          $('#socialinksu6o7x7s').prependTo('#plcolumnu3b567 div.row.grid-row');
        }
});
  if ($(window).width() <= 784){
      $('#socialinksu6o7x7s').prependTo('#navbaru421e6 div.navbar-content-pad');
      $('#socialinksu6o7x7s').css({"float":"left"});
    } else {
      $('#socialinksu6o7x7s').prependTo('#plcolumnu3b567 div.row.grid-row');
    }
  $('td.location_search_street_cell').hide();
  $('#location_search_distance_field option:gt(4)').hide();
  $('.pl-mobile-menu').prepend('<span class="close-pl-menu">X</span>');
    $('.close-pl-menu').click(function(){
      $('.pl-mobile-menu').removeClass('show-menu');
      $('div#site').removeClass('show-mobile-menu');
    });
  
});
  
  </script>

Share this post


Link to post
Share on other sites
Danny

JavaScript isn't my forte. However, for large snippets of JS you shouldn't use the built-in JS editor in DMS, you should enqueue using the WordPress enqueue function via a child theme.

 

http://codex.wordpress.org/Function_Reference/wp_enqueue_script


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×