WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: JavaScript Logic] Just doesn't work (8 posts)

  1. houseofstrauss
    Member
    Posted 5 years ago #

    I was unable to load page specific js files either by the plugin options page or in page options. I've used conditional before hard coded, but there was no sign of this plugin actually doing anything. Any suggestions?

    http://wordpress.org/extend/plugins/javascript-logic/

  2. Justin Tadlock
    Member
    Posted 5 years ago #

    Seems to be working fine to me. Maybe you should post some examples and links to specific problems.

  3. houseofstrauss
    Member
    Posted 5 years ago #

    WordPress 2.7
    I have a plugin wp-spam free that loads /wp-content/plugins/wp-spamfree/js/wpsf-js.php so Logically I only need that on my contact page. Of course it loads globally.

    Javascript logic is installed and nothing configured in the settings page.

    1- In a wp-page I call the spam free plugin <!--spamfree-contact-->
    2- In the meta box javascript logic section, I enter under JavaScript URL: http://mysite.com/wp-content/plugins/wp-spamfree/js/wpsf-js.php which is the plugin script loading file.
    3- This should create a conditional only for that contact page as I understand it.
    Page is saved and viewed.
    4- contact form loads correctly and the script is seen in the source
    5- However, http://mysite.com/wp-content/plugins/wp-spamfree/js/wpsf-js.php loads on every other page in the site also and is seen in the source as an active address. as follows

    <!-- Protected by WP-SpamFree v1.9.6.8 :: JS BEGIN -->
    <script type="text/javascript" src="http://mysite.com/wp-content/plugins/wp-spamfree/js/wpsf-js.php"></script>
    <!-- Protected by WP-SpamFree v1.9.6.8 :: JS END -->

    I expected this script to be hidden in other pages, is that correct?

    I tried using the javascript logic setting page to load this script only on the contact page by using

    set one:
    custom file url: http://mysite.com/wp-content/plugins/wp-spamfree/js/wpsf-js.php

    and Script Logic: is_page('contact')

    which is the page name and slug. Still the script loads in every site page and post.

    Just to be sure, I created another page with the contact form code in it with a different name and slug. This time excluding the conditional instruction in the meta box. I assume it should fail to load the form. In fact it did load the form correctly, proving the conditional call had somehow failed to exclude other pages/posts.

    No cache is running, using arthemia theme, php 5.2.5

    So, I can't make it work... which may be my fault in the way I have used it. Other wise please advise.

    Many thanks for your help, I'm sure it's something simple.

  4. Justin Tadlock
    Member
    Posted 5 years ago #

    You should ask the wp-spam free author how to get his or her script to only load on the contact page. JavaScript Logic does nothing with other plugins' scripts.

  5. houseofstrauss
    Member
    Posted 5 years ago #

    So, you saying that javascript logic can't be used to control other plugin javascripts? If so, I completely missunderstood your plugin. I thought is could control the dreadful dead weight of javascripts that spawn through plugins. My appoligies, Greenshady.

    If your plugin worked as I hoped, what a joy that would be!

  6. houseofstrauss
    Member
    Posted 5 years ago #

    [deleted double post]

  7. Justin Tadlock
    Member
    Posted 5 years ago #

    So, you saying that javascript logic can't be used to control other plugin javascripts?

    Yes, that's what I'm saying.

    I'll add a note in the FAQ in the next update to make this clear.

  8. houseofstrauss
    Member
    Posted 5 years ago #

    Thanks for clarifying that. Topic resolved

Topic Closed

This topic has been closed to new replies.

About this Topic