Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining two bookmarklets
    primarykey
    data
    text
    <p>Yesterday I discovered Bookmarklets and am totally in love. I wrote several to reduce the number of clicks for a few common tasks on my favorite websites. What I would like to do now, if possible, is to combine the actions of two of these bookmarklets into one single script/link. The current set up is as follows: Bookmarklet 1 (B1) performs an action (on URL 1) that loads a page (URL 2) where Bookmarklet 2 (B2) then enters a standard set of data into a form and submits it.</p> <p>I have tried all sorts of variations of the following:</p> <p>javascript:(function(){w=window.open(<em>codeFromB1</em>,'CatchyPageTitle'); w.TryToWriteSomethingToTheTheNewWindowToPassAndCallFunctionB2;)}();</p> <p>But all of my attempts at w.TryToWriteSomethingToTheTheWindow yield errors of varying types. My most recent attempt was to use something like:</p> <p>alert(w.document.getElementsByTagName("form").length); which gives the count from the calling page on the first time called, but the count from the new window on the second time called...</p> <p>So anyway, that's my story for today.</p> <p>In summary, I'm a lost soul in need of guidance. I have two script actions that take place on two different pages that I would like to combine into one code snippet that can be saved as a Bookmarklet. I need someone to point me in the right direction so that I can figure out how to 'link' the two pages/scripts so as to create one spectacular Bookmarklet.</p> <p>Thanks in advance for any help.</p> <hr> <p>Also, I have a mock data Array() that I am using to finish the rest of the script and found one more question for those more intelligent than am I. Part of B2 reads: </p> <p>wdoc.forms[0].t5.value=#; </p> <p>where t5 is the name of the input/text in the form. Why does that work but: </p> <p>thisInput = 't'.concat(i); // where i=5 in the for-loop wdoc.forms[0].thisInput.value=#; </p> <p>gives me an error - "thisInput" is undefined. I also tried creating an array with the input/text names like: </p> <p>document.forms[0].thisInput[i].value=#; </p> <p>but that gives the same error. Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload