Title: JavaScript area is not getting full URL &#8211; Problem
Last modified: August 31, 2016

---

# JavaScript area is not getting full URL – Problem

 *  Resolved [kwright](https://wordpress.org/support/users/kwright/)
 * (@kwright)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/javascript-area-is-not-getting-full-url-problem/)
 * Hi,
 * I have a url which ends with /?param_name=xxxx where xxxx is a number.
    When 
   I use the Twitter Button it does not display the /?param_name=xxxx
 * I have added this to the Additional JavaScript area:
 *     ```
       a2a_config.templates = {
       twitter: "#Skills ${title} ${link} by @SkillBoxes"
       };
       ```
   
 * How can I modify this so that the ${link} includes /?param_name=xxxx?
    Or is 
   there a better way to achieve this?
 * Thanks for your help
    Ken
 * [https://wordpress.org/plugins/add-to-any/](https://wordpress.org/plugins/add-to-any/)

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

 *  Plugin Author [micropat](https://wordpress.org/support/users/micropat/)
 * (@micropat)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/javascript-area-is-not-getting-full-url-problem/#post-6903299)
 * If a page’s current URL already includes those parameters, then you can manually
   place the buttons PHP code in your theme as [suggested here](https://wordpress.org/support/topic/buttons-not-sharing-full-url-w-parameters?replies=5#post-6980022).
 * Otherwise, you can write some JavaScript that uses AddToAny [share event handling](https://www.addtoany.com/buttons/customize/wordpress/events)(
   see “Modifying the share”) to modify the shared URI and add your parameters as
   needed.
 *  Thread Starter [kwright](https://wordpress.org/support/users/kwright/)
 * (@kwright)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/javascript-area-is-not-getting-full-url-problem/#post-6903304)
 * Hi Thanks for the quick response and suggestions.
 * But I don’t think this solves the problem I have.
    The /?param_name=xxxx? is 
   a dynamically generated from a Formidable Pro Form. So one time it could be: /?
   param_name=1234 and the next time /?param_name=4321 and do on each pointing to
   different details from a Form.
 * So I really need the Twitter Button to read the whole line:
    e.g. [http://www.somesite.com/page/?param_name=1234](http://www.somesite.com/page/?param_name=1234)(
   reading the whole URL) but the button does not do this … it only reads [http://www.somesite.com/page](http://www.somesite.com/page)
 * I am not strong on JavaScript but it looks to me like I need to find a way for
   the button “snippet” to read the whole line being displayed in the Browser.
 * Thanks
    Ken
 *  Plugin Author [micropat](https://wordpress.org/support/users/micropat/)
 * (@micropat)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/javascript-area-is-not-getting-full-url-problem/#post-6903362)
 * If those parameters are in the “current URL” (the URL in the browser’s address
   bar), then just have AddToAny share the current URL as the [PHP code here does](https://wordpress.org/support/topic/buttons-not-sharing-full-url-w-parameters?replies=5#post-6980022)(
   Twitter templates will use that URL, too).
 * If those params are _not_ in the current URL, you’ll want to look into making
   that generated URL available in JavaScript as a global variable. The global variable
   will ultimately look something like this when you view a page’s HTML source:
 *     ```
       <script>
       window.my_generated_url = 'http://www.somesite.com/page/?param_name=1234';
       </script>
       ```
   
 * Then you can access that global variable (`window.my_generated_url`) within your
   AddToAny [share event](https://www.addtoany.com/buttons/customize/wordpress/events)
   and change the shared URL.

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

The topic ‘JavaScript area is not getting full URL – Problem’ is closed to new replies.

 * ![](https://ps.w.org/add-to-any/assets/icon.svg?rev=972738)
 * [AddToAny Share Buttons](https://wordpress.org/plugins/add-to-any/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-to-any/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-to-any/)
 * [Active Topics](https://wordpress.org/support/plugin/add-to-any/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-to-any/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-to-any/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [micropat](https://wordpress.org/support/users/micropat/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/javascript-area-is-not-getting-full-url-problem/#post-6903362)
 * Status: resolved