Title: Javascript within php echo do_shortcode
Last modified: August 22, 2016

---

# Javascript within php echo do_shortcode

 *  [jerome330](https://wordpress.org/support/users/jerome330/)
 * (@jerome330)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-within-php-echo-do_shortcode/)
 * Hello all,
 * I’m trying to put a piece of Javascript within a php echo do_shortcode and when
   I do the page become blank after I refresh. I’m still learning PHP and would 
   like to know if this is possible and how to get it working. Here is my code:
 * <?php echo do_shortcode(‘[showto browser=”tablet”]<script language=”javascript”
   >
    document.write(‘<scr’+’ipt async language=”javascript” src=”[http://udmserve.net/udm/img.fetch?sid=7789;tid=1;ev=1;dt=6;cb=’+Math.random()+&#8217](http://udmserve.net/udm/img.fetch?sid=7789;tid=1;ev=1;dt=6;cb=’+Math.random()+&#8217);;”
   ></scr’+’ipt>’); </script>[/showto]’); ?>
 * Thanks!

The topic ‘Javascript within php echo do_shortcode’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [jerome330](https://wordpress.org/support/users/jerome330/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/javascript-within-php-echo-do_shortcode/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
