Civil_777
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Hacks
In reply to: How do I specify the URL in an Ajax call?Nice! It worked. I created a global javascript variable in my child theme functions.php file as follows:
function civil_addto_header() { ?> <script>testpost_url = '<?php echo bloginfo('stylesheet_directory') . '/testpost.php'; ?>';</script> <?php } add_action('wp_head', 'civil_addto_header');Thanks!
Forum: Plugins
In reply to: jQuery post call is not working at allNo problem. I will post the relevant pieces of code.
Javascript that is not working (in the file contact_form.js, which is included in my page through wp_enqueue_script()):
jQuery.post( "contact_form_submit.php", postdata, function(data){ alert(data); });I am expecting a simple alert with the data in it. Instead, I get nothing.
Contents of contact_form_submit.php:
echo "Your form has been submitted.";Includes in the html header of the page in question:
<script type='text/javascript' src='http://mydomain/wp-includes/js/l10n.js?ver=20101110'></script> <script type='text/javascript' src='http://mydomain/wp-includes/js/jquery/jquery.js?ver=1.6.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/randombg.jquery.js?ver=0.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/DOMAssistantCompressed.js?ver=3.2.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/ie-css3.js?ver=3.2.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/PreloadCssImages.jQuery_v5.js?ver=5'></script> <script type='text/javascript' src='http://www.google.com/jsapi?ver=3.2.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/search_input.js?ver=3.2.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/tableH.js?ver=3.2.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/custom.js?ver=1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/hoverbox.js?ver=3.2.1'></script> <script type='text/javascript' src='http://mydomain/wp-content/themes/mytheme/js/contact_form.js?ver=3.2.1'></script>Forum: Themes and Templates
In reply to: How to undo wp_enqueue_script?Great, thanks!
Not sure I understand the Steve Jobs comment…
Forum: Themes and Templates
In reply to: How to include custom jqueryThanks, that is what I need. I have a few more questions about how to use wp_enqueue_script. I will post those questions separately.
Viewing 4 replies - 1 through 4 (of 4 total)