javascript bookmarklet with input -
i trying create javascript bookmarklet iterate values within.
basically i'm trying input
{ "type": "collection", "id": "home_featured_collections_7" },
then input values current iteration 7 , final iteration 10 , output like
{ "type": "collection", "id": "home_featured_collections_7" }, { "type": "collection", "id": "home_featured_collections_8" }, { "type": "collection", "id": "home_featured_collections_9" }, { "type": "collection", "id": "home_featured_collections_10" },
my first instinct have copy original text clipboard , output clipboard couldn't figure out how this. i've set using prompts
javascript:(function(){ text=prompt("expand text", ""); current=prompt("current iteration", ""); final=prompt("final iteration", ""); return_text = ""; (i = current; <= final; i++) { return_text += text.replace(current, i); } prompt("copy clipboard: ctrl+c, enter",return_text);}() );
but having little trouble. quotes , colon causing trouble or @ least assume case. first time making js bookmarklet apologize if there better ways this.
any advice great!
Comments
Post a Comment