Title: Javascript in Wpi Designer Button
Last modified: March 22, 2017

---

# Javascript in Wpi Designer Button

 *  [slmwilkinson](https://wordpress.org/support/users/slmwilkinson/)
 * (@slmwilkinson)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/)
 * I need to add javascript to a button created with WPi Designer Button Shortcode.
   Where do I add the script in order to make it run. I put it in the Advanced Link
   section, but it doesn’t seem to run, just refreshes the current screen. I have
   seen posts on the forum for the same request (a quick exit button) but can’t 
   find any explanation of how to get it to work.

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

 *  Plugin Author [WooPrali](https://wordpress.org/support/users/wooprali/)
 * (@wooprali)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-8949813)
 * Hi ,thanks for using designer button plugin.
 * I will check and fix asap.
 * Regards,
 * Prali
 *  Plugin Author [WooPrali](https://wordpress.org/support/users/wooprali/)
 * (@wooprali)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-8950939)
 * Hi,
 * Please check this link.
    [http://designerbutton.prali.in/how-to-track-button-click-using-google-analytics-tracking-code/](http://designerbutton.prali.in/how-to-track-button-click-using-google-analytics-tracking-code/)
 * Regards,
    Prali
 *  [motumotu](https://wordpress.org/support/users/motumotu/)
 * (@motumotu)
 * [9 years ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-9106448)
 * I’m having the same issue. Tried to put Javascript in the Advanced Link Section,
   but it just refreshes the page when clicked. I noticed in Firebug it’s throwing
   an error saying “invalid character”.
 * I think what it’s doing is changing the quotes to curly tick marks. Should be‘
   but changes to ’ when you save it. Same thing happens to double quote marks. 
   I put in ” but it changes to ” when you save it. Any way to fix that?
 *  Plugin Author [WooPrali](https://wordpress.org/support/users/wooprali/)
 * (@wooprali)
 * [9 years ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-9107237)
 * Hi,
 * If possible please give me the website link. So i can check the issue.
 * Regards,
 * PRALI
 *  [merceditas008](https://wordpress.org/support/users/merceditas008/)
 * (@merceditas008)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-9187004)
 * Hello,
    I am trying to create a scape button too that redirects to weather.com
   and cleans the browser. But the code I am adding in the advance link section 
   is not working. This is the code:
 * window.open(“[http://weather.com&#8221](http://weather.com&#8221);, “_newtab”);
   window.location.replace(‘[http://google.com&#8217](http://google.com&#8217););
 * Could you please advice?
    thanks
 *  Thread Starter [slmwilkinson](https://wordpress.org/support/users/slmwilkinson/)
 * (@slmwilkinson)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-9190796)
 * Sadly, I was not able to make this work. I finally linked to an external html
   page that performed the redirect. I never got the browser clearing to work.
 *  Plugin Author [WooPrali](https://wordpress.org/support/users/wooprali/)
 * (@wooprali)
 * [8 years, 12 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-9191043)
 * Hi,
 * Thanks for using designer button plugin.
 * You need to add `javascript:` before your code.
 * Ex: `javascript:pageTracker._trackPageview (‘example’)`
 * Ex: `javascript:window.open(“http://weather.com”, “_newtab”);window.location.
   replace(‘http://google.com’);`
 * If any issues please let me know.
 * Regards,
 * PRALI

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

The topic ‘Javascript in Wpi Designer Button’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpi-designer-button-shortcode_413a0e.
   svg)
 * [WPi Designer Button](https://wordpress.org/plugins/wpi-designer-button-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpi-designer-button-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/reviews/)

## Tags

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

 * 7 replies
 * 4 participants
 * Last reply from: [WooPrali](https://wordpress.org/support/users/wooprali/)
 * Last activity: [8 years, 12 months ago](https://wordpress.org/support/topic/javascript-in-wpi-designer-button/#post-9191043)
 * Status: not resolved