I'm attempting to use javascript to modify the url on page. This URL is then being passed into the bit.ly bookmarklet to be shortened. My script will append a parameter to the URL and insert it into the URL field of the bit.ly bookmarklet. If this works i would combine the code of the bit.ly bookmarklet with the script to automatically perform its task.
The process is as follows:
Run bit.ly bookmarklet, run my script to append parameter, use bit.ly bookmarklet
Source of bit.ly bookmarklet
<div id="mainUnAuthShortenContainer" class="inputBoxContainer">
<input tabindex="1" id="shortenUnAuthContainer" name="url" value="https://www.google.com/" type="text">
</div>
My script
var elem = document.getElementById("shortenUnAuthContainer");
elem.value = window.location + "?Parameter";
My script works in JSFiddle but not in real application. It does nothing when applied to the actual bit.ly bookmarklet. Any help is appreciated.
The bit.ly bookmarklet for reference. Thanks!