WordPress.org

Ready to get started?Download WordPress

Forums

Plugin: Jquery UI Widgets - Adding code to header (1 post)

  1. EarlSnappy
    Member
    Posted 1 year ago #

    Hi I'm using the code below on my page from a plugin (a button whcih onclick triggers a dialogue/text box with contact info in it), and it works fine, but I don't want the <script> on the actual WordPress page, I want it in headers or elsewhere because if I put it on the page itself it creates 'white space'. I tried adding it to my child theme header, but unlike other plugins I've done that with it didn't work.

    <script src="http://code.jquery.com/jquery-1.9.0.js"></script>
    <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
    <button id="opener">open the dialog</button>
    <div id="dialog" title="Dialog Title">I'm a dialog</div>
    <script>
    $( "#dialog" ).dialog({ autoOpen: false });
    $( "#opener" ).click(function() {
    $( "#dialog" ).dialog( "open" );
    });
    </script>

    All I want on the actual wordpress page is :

    <button id="opener">open the dialog</button>
    <div id="dialog" title="Dialog Title">I'm a dialog</div>

    Thanks Earl

Topic Closed

This topic has been closed to new replies.

About this Topic