ThemeShaper Forums » Thematic

[closed]

Javascript event works locally but not live

(3 posts)
  • Started 13 years ago by helgatheviking
  • Latest reply from helgatheviking
  • This topic is resolved
  1. This is not a thematic question, but I am already a member of this forum so thought maybe someone here would know.

    i got thematic to add the following to the header:
    <script type="text/javascript" src="http://localhost/jruthless/wp-content/themes/child-landing-page/scripts/pricecalc.js"></script>

    using

    // add price calculation script to header
    
    function my_in_head(){
    if (is_page_template('landingpage.php')){
    ?>
    <script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/scripts/pricecalc.js"></script>
    
    <?php } else {
    //do nothing
    }
     }
    
    add_action('wp_head', 'my_in_head');

    then in a form i call a function defined in that script on the onSubmit event.

    thought I was a genius b/c it works on my localhost test site. But got it live at:

    http://www.betonyourselftoquitsmoking.com/paypal-test/

    and no joy. Is there any reason it would work locally and not live?

    Thanks in advance and I apologize again for being off topic.

    Posted 13 years ago #
  2. The path leads to the childtheme-dir/scripts. Make sure you actually have the script in there. If so then try renaming it and/or checking the permissions of the js file and scripts directory.

    Posted 13 years ago #
  3. Hi Gene,

    I was hoping you would reply! Your post sent me looking in exactly the right direction. I had password protected that scripts directory. Unprotected it, cleared the cache and all is well. Thanks for your quick help.

    Posted 13 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.