replace .copy-paste with on page load?
-
I was wondering if anyone might know how to change this code so the copy-paste function is changed to a function that just pastes when the page loads, without the click?
In functions.php
function imath_copy_paste(){ { ?> <script type="text/javascript"> jQuery('.copy-paste').click(function(){ var shortcode = jQuery(this).find(":first").val(); jQuery("#content-text-ta").val(jQuery("#content-text-ta").val()+shortcode); }); </script>
In a custom page template:
<div class="copy-paste"> <input type="hidden" id="copy-paste-shortcode" value="[xilipostinpost query='name=<?php echo $post->post_name;?>'] " <a href="javascript:void(0)" title="click here to add this contnent to the entry form on the right.">add this entry to my trip!</a> </div>
I don’t really know Java, hoping it’s a simple adjustment.
thanks!
- The topic ‘replace .copy-paste with on page load?’ is closed to new replies.