WordPress.org

Ready to get started?Download WordPress

Forums

Last.Fm Records
[resolved] Disable jquery script on all but one page? (6 posts)

  1. marky_uk
    Member
    Posted 1 year ago #

    Hi Jeroen

    I see that your plugin adds this ...

    <script type='text/javascript'>
        jQuery(document).ready( function() {
          jQuery('#lastfmrecords').lastFmRecords(lfr_config);
        });
      </script>

    ... to the header of every page, yet I only show albums on the About Us page of our site. I know how to disable enqueue scripts (done for JQuery, etc) but not sure how to disable your code apart from on one page.

    Any ideas how I can do this?

    Thanks in advance!

    Mark

    http://wordpress.org/extend/plugins/lastfm-records/

  2. jeroensmeets
    Member
    Plugin Author

    Posted 1 year ago #

    Mark, good point. The transition to the new shortcode setup is obviously not yet complete. Todo item for my plugin is: a page can contain the widget and/or a shortcode. Depending on the page the code needs some js and css files.

    jQuery('#lastfmrecords') has length zero on pages with no widget or shortcodes, so the weight is minimal, yet can be optimized. It's on my list.

  3. jeroensmeets
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Mark,

    this issue has been fixed in the new version. Unfortunately, I'm having trouble committing it to wordpress.org. Hope to have it online soon!

  4. jeroensmeets
    Member
    Plugin Author

    Posted 1 year ago #

    Mark, the new version has been submitted to wordpress.org. WordPress will tell you about the update.

  5. marky_uk
    Member
    Posted 1 year ago #

    Yay, smashing ... thanks a lot for updating this ... 3 times :-) Really kind .. will go and get the latest ... :-)

  6. jeroensmeets
    Member
    Plugin Author

    Posted 1 year ago #

    You're welcome! The latest will do ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.