• 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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>

    Thread Starter stereosushi

    (@stereosushi)

    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.

    Thread Starter stereosushi

    (@stereosushi)

    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&#8221;)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

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using own js scripts’ is closed to new replies.