Compare and Contrast
The provided HTML snippet includes a “Read More” button and a hidden form for submitting corrections or messages. Here’s a summary of the main components and their functionality:
1. **Read More Button**: The `
2. **Form Structure**: The “ element is styled to be hidden initially. It includes fields for the user’s name (marked as required and contains a validation message), an unnamed required text field, and a message area (also required). This form allows users to submit corrections or comments.
3. **Submission Handling**: The form’s submission is handled by the `firefly_sc()` JavaScript function, which prevents the default submission action to enable custom handling. It also integrates Google reCAPTCHA to validate submissions and prevent spam. If required fields are not completed, an error message is displayed.
For more A.F. Branco cartoons, go to WesternJournal.com/cartoons.
function firefly_sc() { if( typeof window.captchaPublicKey==typeof undefined ){ console.error(‘window.captchaPublicKey is not defined’); } grecaptcha.execute( window.captchaPublicKey, { action: ‘submit_correction’ } ).then( function( token ) { var opts={ action: ‘firefly_sc_submit’, name: document.querySelector( ‘.entry-submit-correction [name=”name”]’ ).value, : document.querySelector( ‘.entry-submit-correction [name=””]’ ).value, message: document.querySelector( ‘.entry-submit-correction [name=”message”]’ ).value, post_id: firefly_post_id, cap_token: token } var inputs=[ ‘name’, ”, ‘message’ ]; for( var i=0; i <inputs.length; i++ ) if( ! ( opts[inputs[i]]=document.querySelector( '.entry-submit-correction [name="' + inputs[i] + '"]' ).value ) ) { document.querySelector( '.entry-submit-correction .required-message' ).style.display='block'; return; } document.querySelector( '.entry-submit-correction input[type="submit"]' ).style.display='none'; document.querySelector( '.entry-submit-correction .firefly-sc-submitting-img' ).src=firefly_loading_gif_url; document.querySelector( '.entry-submit-correction .firefly-sc-submitting-img' ).style.display='inline-block'; console.log( 'ma subbing' ); if( firefly_post_id ) opts['post_id']=firefly_post_id; /* Send the data using post with element id name and name2*/ var posting=jQuery.post( firefly_ajax_url, opts ); /* Alerts the results */ posting.done( function( response ) { if( response.success ) { console.log( response.data ); document.querySelector( '.entry-submit-correction .firefly-sc-submitting-img' ).style.display='none'; document.querySelector( '.entry-submit-correction .firefly-sc-confirm' ).style.display='block'; dataLayer.push( { 'event': 'submit-correction' } ); } }); }); }
Advertise with The Western Journal and reach millions of highly engaged readers, while supporting our work. Advertise Today.
console.log(“ad slot (BA1)”)
.insticator-unit.type-commenting{margin: 0 10px 25px 10px}@media screen and (max-width:1060px){#div-insticator-ad-cmt-1, #div-insticator-ad-cmt-2, #div-insticator-ad-cmt-3, #div-insticator-ad-cmt-4{margin: 0 auto 25px auto !important;}}#div-insticator-ad-cmt-1, #div-insticator-ad-cmt-2, #div-insticator-ad-cmt-3, #div-insticator-ad-cmt-4{height: 280px !important; width: 336px !important}
" Conservative News Daily does not always share or support the views and opinions expressed here; they are just those of the writer."


