Support » Themes and Templates » How to call Javascript inside sidebar?

  • Hi,

    I want to have apop-up message when users click on a buton in sidebar. So I create a javascript file named prob.js:

    // JavaScript Document
    function disp_alert()

    then I add this code to header.php:

    <script src="/javascript/prob.js" type="text/javascript"></script>

    after that, i add to the top of the sidebar.php file:
    <?php get_header(); ?>
    But nothing happens! I wonder how can I call it then!!

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Surely your get_header() call is being made somewhere else, i.e., the index.php? If sidebar is included in the index file, it should already have the javascript.

    What is your html code for the link where the button is clicked?

Viewing 1 replies (of 1 total)
  • The topic ‘How to call Javascript inside sidebar?’ is closed to new replies.