Forums

Using own js scripts (4 posts)

  1. stereosushi
    Member
    Posted 4 years ago #

    Hello,

    I want to use some jquery plugins in wordpress. So i searched a bit and found how to add script to wordpress header.

    On wp-includes/ theres a file called script-loader.php
    I added
    $scripts->add( 'jquery-watermarkinput', '/wp-includes/js/jquery/jquery.watermarkinput.js', array('jquery'), '0.1' );
    To call this js under jquery's js.

    Now i have to add a script on my body to use this plugin, which will be like;

    <script type="text/javascript">
    $(document).ready(function(){
    $("#s").Watermark("search..");
    )};
    </script>

    I added it to my header.php after </head> element but after i run my page i saw an syntax error in file called tw-sack.js which is a wordpress file.
    I need your help to achieve this problem. I look around codex but i didint find anything.
    Thanks

  2. Samuel B
    moderator
    Posted 4 years ago #

    Now i have to add a script on my body to use this plugin, which will be like;

    <script type="text/javascript">
    $(document).ready(function(){
    $("#s").Watermark("search..");
    )};
    </script>

    try putting that in footer.php before the closing <div>

  3. stereosushi
    Member
    Posted 4 years ago #

    I tried it before but firebug shows same error again.
    Syntax error on tw-sack.js.
    I dont know why this cause an error on tw-sack.js.

  4. stereosushi
    Member
    Posted 4 years ago #

    Whole error info:

    syntax error
    createAJAX()()tw-sack....ver=1.6.1 (line 43)
    sack("http://www.xxxx.net/wp-content/plugins/wp-postratings/wp-postratings.php")tw-sack....ver=1.6.1 (line 192)
    eval()()postrati...e3Q%3D%3D (line 1)
    postratings-js-packed.js?ver=1.40()()postrati...?ver=1.40 (line 1)
    [Break on this error] )};\n

Topic Closed

This topic has been closed to new replies.

About this Topic