Javascript working in Table maker but not tablepress
-
Hello Sir,
I have been trying to figure out why the javascript code I am using is not working in your plugin but is working in table press, below is what is in my header.php theme doc.
session_start(); ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="initial-scale=1, maximum-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <?php wp_head(); ?> <?php //echo $_SESSION['product_title'];?> <?php //wp_footer(); ?> <script type="text/javascript"> //(function() { jQuery( document ).ready(function() { /*jQuery( ".apply_button" ).click(function() { alert(jQuery(this).closest('tr td span.product_title').text()); });*/ //jQuery("input[name='product-name']").val( "Test" ); //jQuery('[name="product-name"]').val('new test'); //alert('<?php echo $_SESSION['product_title'];?>'); jQuery("#product_name").val('<?php echo $_SESSION['product_title'];?>'); jQuery( ".apply_business" ).click(function() { var product_title = jQuery(this).closest('tr').find('.product_title').text(); var src = product_title; // alert(src); //var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; // Send Ajax request to backend.php, with src set as "img" in the POST data // jQuery.post("<?php echo home_url(); ?>/tempajax.php", {"product_title": src}); var ajaxurl = '<?php echo home_url('tempajax.php'); ?>'; jQuery.post(ajaxurl, { action: 'product_new_title', product_title: src }, function(output) { // alert(output); window.location.href = 'http://blactec.co.za/business-connectivity-form/'; }); }); //jQuery( ".apply_button" ).click(function() { jQuery(document).on('click', '.small-only a.apply_button', function() { var product_title = jQuery(this).closest('tr').prev().prev().prev().prev().prev().prev().prev().find('.product_title').text(); var src = product_title; //var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; // jQuery.post("<?php echo home_url(); ?>/tempajax.php", {"product_title": src}); var ajaxurl = '<?php echo home_url('tempajax.php'); ?>'; jQuery.post(ajaxurl, { action: 'product_new_title', product_title: src }, function(output) { //alert(output); window.location.href = 'http://blactec.co.za/form/'; }); }); jQuery(document).on('click', '.large-only a.apply_button', function() { var product_title = jQuery(this).closest('tr').find('.product_title').text(); var src = product_title; //var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; // jQuery.post("<?php echo home_url(); ?>/tempajax.php", {"product_title": src}); var ajaxurl = '<?php echo home_url('tempajax.php'); ?>'; jQuery.post(ajaxurl, { action: 'product_new_title', product_title: src }, function(output) { //alert(output); window.location.href = 'http://blactec.co.za/form/'; }); }); jQuery( ".apply_button_single" ).click(function() { var product_title = jQuery(this).closest('table').find('.product_title_single').text(); var src = product_title; // alert(src); //var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; // Send Ajax request to backend.php, with src set as "img" in the POST data // jQuery.post("<?php echo home_url(); ?>/tempajax.php", {"product_title": src}); var ajaxurl = '<?php echo home_url('tempajax.php'); ?>'; jQuery.post(ajaxurl, { action: 'product_new_title', product_title: src }, function(output) { // alert(output); window.location.href = 'http://blactec.co.za/form/'; }); }); }); </script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-114103868-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-114103868-1'); </script> </head> <?php global $dazimaxx_opt; $dazimaxx_layout_width = $dazimaxx_opt['dazimaxx_layout_width']; if ( isset( $dazimaxx_layout_width ) ) { $dazimaxx_layout_width_value = $dazimaxx_layout_width; } else { $dazimaxx_layout_width_value = $dazimaxx_layout_width; }; ?> <body <?php body_class(); ?>> <div id="page" class="site site-wrapper <?php echo esc_attr( $dazimaxx_layout_width_value ); ?>"> <div id="dazimaxx"> <header class="header-main"> <?php $dazimaxx_topbar_style = $dazimaxx_opt['dazimaxx_header_top_width']; $page_topbar_switcher = get_post_meta(get_the_ID(),'_dazimaxx_page_topbar_style', true); $page_topbar_style = ''; if($page_topbar_switcher != 'none'){ $page_topbar_style = $page_topbar_switcher; } else { $page_topbar_style = $dazimaxx_topbar_style; } if($page_topbar_style == 1){ get_template_part('/inc/header/header-top-bar-fullwidth'); } else { get_template_part('/inc/header/header-top-bar'); } $dazimaxx_header_style = $dazimaxx_opt['dazimaxx_header_layout']; $single_header_switcher = get_post_meta(get_the_ID(),'_dazimaxx_page_menu_style', true); $page_header_style = ''; if($dazimaxx_header_style){ $page_header_style = $dazimaxx_header_style; } if($single_header_switcher != 'none'){ $page_header_style = $single_header_switcher; } if($page_header_style == 'header_full_width'){ get_template_part( 'inc/header/header-full-width'); }elseif($page_header_style == 'header_style_2'){ get_template_part( 'inc/header/header-2'); }elseif($page_header_style == 'header_one_page'){ get_template_part( 'inc/header/header-one-page'); }else{ get_template_part( 'inc/header/header-1'); } ?> </header> <div id="content" class="site-content">The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Javascript working in Table maker but not tablepress’ is closed to new replies.