WPIntell

Source evidence

Script in buttons?

Forget About Shortcode Buttons · support · 2019-02-20T17:47:00+00:00

complaintsentiment
highseverity
0.97relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 29 rows with source links

20.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Lars.Lemming unresolved
I am looking to find out if I can place a script in a button so activation of it will triggers the script. If it is possible, which and where do I place the various elements in the button? I hope someone can help me! The code for my button looks like this: For Test And the script I wish to trigger looks like this: <script> jQuery(document).ready(function($) { $(‘.selected-package_3400’).click(function(){ var title = $(“.pack_title_3400”).attr(‘packtitle’); var packid = “3400”; var current_user_email = “XXX@XXXXXXXXXXXX.co.uk”; var current_user_id = “11”; var price = $(“.price_3400”).attr(‘packprice’); var price1 = $(“.price_3400”).attr(‘packprice1’); var time = $(“.pack_time_3400”).attr(‘packtime’); var recurring = $(“.pack_recurring_3400”).attr(‘recurring’); var listing = $(“.pack_listing_3400”).attr(‘listing’); var featured_listing = $(“.pack_featured_listing_3400”).attr(‘featured_listing’); var pack_date = $(“.pack_time_3400”).attr(‘pack_date’); var pack_time = $(“.pack_time_3400”).attr(‘pack_time’); var paypalMerchantEmail1 = “”; var paypalUrlmode = “sandbox”; var pack_currency = “£”; var currency_placement = “before”; var currency_code11 = “USD”; var currency_sign1 = “£”; if(price1 == 0){ var data = { action: ‘packages_free_action’, current_user_email: current_user_email, current_user_id: current_user_id, title: title, time: time, packid: packid, price: price, price1: price1, listing: listing, recurring: recurring, featured_listing: featured_listing, pack_date: pack_date, pack_time: pack_time, paypalMerchantEmail1: paypalMerchantEmail1, paypalUrlmode: paypalUrlmode, pack_currency: pack_currency, currency_placement: currency_placement }; $(‘#loadingmessage’).show(); $.ajax({ type: ‘POST’, url: “ https://XXXXXXXX.com/wp-admin/admin-ajax.php” ;, data: data, success: function(response) { if(response !=””){ $(“.response”).html(”).html(response); $(“.tablinks”).removeClass(‘active’); $(“.tablinks:nth-child(3)”).addClass(‘active’) $(“.tabcontent”).css(‘display’,’none’); $(“#Done”).css(‘display’,’block’); $(‘#loadingmessage’).hide(); } else{ console.log(’empty’); } } }) } else{ var data = { action: ‘packages_pass_action’, current_user_email: current_user_email, current_user_id: current_user_id, title: title, time: time, packid: packid, price: price, price1: price1, listing: listing, recurring: recurring, featured_listing: featured_listing, pack_date: pack_date, pack_time: pack_time, paypalMerchantEmail1: paypalMerchantEmail1, paypalUrlmode: paypalUrlmode, pack_currency: pack_currency, currency_placement: currency_placement, currency_code11: currency_code11, currency_sign1: currency_sign1 }; $(‘#loadingmessage’).show(); $.ajax({ type: ‘POST’, url: “ https://XXXXXXXXXXXX.com/wp-admin/admin-ajax.php” ;, data: data, success: function(response) { if(response !=””){ $(“.payment-content”).html(”).html(response); $(“.tablinks”).removeClass(‘active’); $(“.tablinks:nth-child(2)”).addClass(‘active’) $(“.tabcontent”).css(‘display’,’none’); $(“#Payment”).css(‘display’,’block’); $(‘#loadingmessage’).hide(); } else{ console.log(’empty’); } } }) } }); }); </Script>

Comments

0 shown

No comments were stored for this source.