Redirect to new url

It doesn’t seem to have been.
I searched for jQuery("form") in the source code with no sucess

That’s strange, I don’t see it either but it is in the footer template file.

I see now there is a way to add code to the footer using the List Fusion plugin. I will add the script there now.

You’re adding that before you are including the jQuery library.
This results in the error: Uncaught ReferenceError: jQuery is not defined
It needs to be after.

Ok, I added it to the page template just before the closing body tag.

Try changing the contents of the following file like so:

http://free-seo-audit.rank1stseo.co.nz/wp-content/plugins/list-fusion/lib/user-lib/squeeze-pg/custom.js

(function($){
  var timer = false;

  $(document).ready(function(){
    // check name and email
    $('#listfusion-submit-btn').click(function(e) {
      var emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
      var emailaddressVal = $('#'+listfusion_item_squeezepg.emailFldID).val();
      // csv records
      var displayEmail = $('#'+listfusion_item_squeezepg.emailFldID).val();
      var displayFirstName = $('#'+listfusion_item_squeezepg.firstNameFldID).val();
      var displayLastName = $('#'+listfusion_item_squeezepg.lastNameFldID).val();
      var displayName = $('#'+listfusion_item_squeezepg.nameFldID).val();
      var currentUserIP = listfusion_item_squeezepg.userIP;
      var globalcsv = displayFirstName +','+ displayLastName  +','+ displayName  +','+ displayEmail +','+ currentUserIP;
      var itemID = listfusion_item_squeezepg.displayItemID;
      // Eof csv records
      if( !emailReg.test( emailaddressVal.replace(/^\s+|\s+$/g,"") ) ) {
        alert('- Valid Email Required.');
        $('#'+listfusion_item_squeezepg.emailFldID).focus();
        return false;
      } else {
        if( listfusion_item_squeezepg.addCSV != 2 ) {
          listfusion_set_sqpg_cookie(listfusion_item_squeezepg.clickIDName,listfusion_item_squeezepg.displayItemID,'1');
        }
        if( listfusion_item_squeezepg.addCSV == 1 ) {
          listfusion_set_sqpg_cookie('itemcsv-'+itemID,globalcsv,'1');
        }

        e.preventDefault();
        setTimeout(function(){
          window.location.replace( 'http://example.com/' );
        }, 2500);

        return true;
      }
    });
  });
  // Set cookie
  function listfusion_set_sqpg_cookie(name,value,expires){
    var path = ''; var domain = ''; var secure = '';
    var today = new Date();
    today.setTime( today.getTime() );
    if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; }
    var expires_date = new Date( today.getTime() + (expires) );
    document.cookie = name + "=" +escape( value ) +
    ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
    ( ( path ) ? ";path=" + path : "" ) +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ( ( secure ) ? ";secure" : "" );
  };

})(jQuery);

This works for me, but I wouldn’t be surprised if the plugin is doing something weird behind the scenes.

Ok, it’s now redirecting but subscribers are not being added to the list. Maybe needs some more tweaking?

Yeah, I thought as much.
At this point, I would attempt to contact the plugin author to see what the preferred method is to handle this scenario.

It’s a tricky one, that’s for sure! I tried contacting them before but they weren’t much help. Anyway, I really appreciate your help.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.