Title: Using own js scripts
Last modified: August 19, 2016

---

# Using own js scripts

 *  [stereosushi](https://wordpress.org/support/users/stereosushi/)
 * (@stereosushi)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-own-js-scripts/)
 * 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)

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-own-js-scripts/#post-978258)
 * > 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](https://wordpress.org/support/users/stereosushi/)
 * (@stereosushi)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-own-js-scripts/#post-978283)
 * 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](https://wordpress.org/support/users/stereosushi/)
 * (@stereosushi)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/using-own-js-scripts/#post-978284)
 * 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](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.

## Tags

 * [external](https://wordpress.org/support/topic-tag/external/)
 * [java-script](https://wordpress.org/support/topic-tag/java-script/)

 * 3 replies
 * 2 participants
 * Last reply from: [stereosushi](https://wordpress.org/support/users/stereosushi/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/using-own-js-scripts/#post-978284)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
