Title: How run javascript codes in header.php or index.php???
Last modified: August 21, 2016

---

# How run javascript codes in header.php or index.php???

 *  [msgh](https://wordpress.org/support/users/msgh/)
 * (@msgh)
 * [13 years ago](https://wordpress.org/support/topic/how-run-javascript-codes-in-headerphp-or-indexphp/)
 * Hi Experts,
 * I read many many articles on internet by googling. I also read that its not work
   because of security purpose of CMS. But not got solution of my problem. All copied
   codes run on websites. I also read the below link how add javascript in wordpress
   but fail to success 🙁
 * [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)
 * I post my codes here please please help me. Help will be appreciated
 * //Codes Start
 *     ```
       <script type="text/javascript" src=" <?php get_stylesheet_directory(); ?>/js/test.js"></script>
       <IMG SRC="<?php bloginfo('stylesheet_directory'); ?>/images/soimg.gif" ALIGN="RIGHT" CLASS="cu"
         ONCLICK="Showcase();return false"  id="camimg" />
         <P CLASS="tx"><B CLASS="cu" onclick="Showcase();return false">Showcase</B></P>
         <P id="sctxt">View all our products / services as a slide show.</P>
         <P CLASS="re"><b onclick="Showcase(); return false" CLASS="cu"><IMG SRC="<?php bloginfo('stylesheet_directory'); ?>/images/sarr.gif" ALIGN="left">  play now</b></P>
   
       <SCRIPT TYPE="text/javascript"><!--//--><![CDATA[//><!--
       function Showcase() { var googlewin=dhtmlwindow.open("googlebox", "iframe", "<?php get_template_directory_uri(); ?>/showcase.php", "", "width=510px,height=384px,resize=0,scrolling=0,center=1", "recal") } //--><!]]> </SCRIPT>
       //Code End
       ```
   
 * **_[Please use the code buttons when posting code – as is your code may have 
   been corrupted ]_**
 * I want run javascript code when click on showcase title or play title to open
   new windows. but its not working.
 * Please Help solve this problem. I need it.. I spent one day to got the solution
   but fail.
 * Thanks
 * Regards
    Msgh

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

 *  [kmessinger](https://wordpress.org/support/users/kmessinger/)
 * (@kmessinger)
 * [13 years ago](https://wordpress.org/support/topic/how-run-javascript-codes-in-headerphp-or-indexphp/#post-3772137)
 * > I want run javascript code when click on showcase title or play title to open
   > new windows.
 * You don’t need any script to do that. The link should have target set like this.
   [link name](https://wordpress.org/support/topic/how-run-javascript-codes-in-headerphp-or-indexphp/file?output_format=md)
 *  Thread Starter [msgh](https://wordpress.org/support/users/msgh/)
 * (@msgh)
 * [13 years ago](https://wordpress.org/support/topic/how-run-javascript-codes-in-headerphp-or-indexphp/#post-3772196)
 * Hi KMESSINGER,
 * Thanks for reply… Yes i can set target of link…
 * Thanks for suggestion. But can you tell me how integrate javascript code inside
   header.php or any other page of wordpress.
 * Thanks again

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

The topic ‘How run javascript codes in header.php or index.php???’ is closed to 
new replies.

## Tags

 * [javascript in wordpress](https://wordpress.org/support/topic-tag/javascript-in-wordpress/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [msgh](https://wordpress.org/support/users/msgh/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/how-run-javascript-codes-in-headerphp-or-indexphp/#post-3772196)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
