<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>e dot dot dot   </title>
    <link>http://www.jamesraposa.com/index</link>
    <description>e dot dot dot - a mostly about the Internet weblog by James Raposa</description>
    <language>en</language>

  <item>
    <title>Universal JS Download Modal Triggering Code</title>
    <link>http://www.jamesraposa.com/index/2025/04/09#Universal_JS_Download_Modal_Triggering_Code</link>
    <description>This handy javascript programming takes two incoming arguments, and invokes the download dialogue modal for any text supplied to it. Just provide it with a fileName (to be used when saving the &quot;file&quot;), and fileContents, and see for yourself.&lt;br /&gt;&lt;br /&gt;Highlight and copy the Javascript code below, starting with the &quot;function&quot; line, and ending with the very last right-squiggly-bracket that's followed by a semi-colon.&lt;br /&gt;&lt;br /&gt;#########################################################&lt;br /&gt;JS Programming Below&lt;br /&gt;#########################################################&lt;br /&gt;function createAndDownloadFile(fileName, fileContent) {&lt;br /&gt;&lt;br /&gt;// Create a Blob from the content (assuming it's text data)&lt;br /&gt;const blob = new Blob([fileContent], { type: 'text/plain' });&lt;br /&gt;&lt;br /&gt;// Create an object URL for the Blob&lt;br /&gt;const url = URL.createObjectURL(blob);&lt;br /&gt;&lt;br /&gt;// Create an anchor element&lt;br /&gt;const a = document.createElement('a');&lt;br /&gt;&lt;br /&gt;// Set the download attribute with the specified file name&lt;br /&gt;a.download = fileName;&lt;br /&gt;&lt;br /&gt;// Set the href attribute to the Blob URL&lt;br /&gt;a.href = url;&lt;br /&gt;&lt;br /&gt;// Append the anchor element to the document body (required for Firefox)&lt;br /&gt;document.body.appendChild(a);&lt;br /&gt;&lt;br /&gt;// Trigger a click on the anchor element to start the download&lt;br /&gt;a.click();&lt;br /&gt;&lt;br /&gt;// Clean up by removing the anchor element&lt;br /&gt;document.body.removeChild(a);&lt;br /&gt;&lt;br /&gt;// Optionally, release the object URL after use to free memory&lt;br /&gt;URL.revokeObjectURL(url);&lt;br /&gt;};&lt;br /&gt;#########################################################&lt;br /&gt;JS Programming Above&lt;br /&gt;#########################################################</description>
  </item>
  <item>
    <title>Spoof Check</title>
    <link>http://www.jamesraposa.com/index/2006/12/06#spoof_check</link>
    <description>Here's a simple but effective tool in the fight against &lt;a href=&quot;http://www.techterms.org/definition/phishing&quot; target=&quot;_blank&quot; title=&quot;click for a definition of the term&quot;&gt;phishing&lt;/a&gt; and ultimately, identity theft.&lt;br /&gt;&lt;br /&gt;Save this as a toolbar bookmark (a bookmarklet), and use it to check if you've visited a &quot;spoofed&quot; site or not.&lt;br /&gt;&lt;br /&gt;tip: left-click and drag this site's url icon to your toolbar, then right-click it to edit its properties, and change the &quot;location&quot; to contain the code below, and the &quot;name&quot; to Spoof Check.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;javascript:alert(&quot;The actual URL is:\t\t&quot; + location.protocol + &quot;//&quot; + location.hostname + &quot;/&quot; + &quot;\nThe address URL is:\t\t&quot; + location.href + &quot;\n&quot; + &quot;\nIf the server names do not match, this may be a spoof.&quot;);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;!--ttag:javascript, bookmarks, scriptlets, bookmarklets--&gt;</description>
  </item>
  <item>
    <title>Libraries Make A Coder's Life Easier</title>
    <link>http://www.jamesraposa.com/index/2006/02/16#libraries</link>
    <description>And I'm not talking about the kinds with old fashioned card catalogs and ornery ladies with blue hair and reading spectacles around their necks.&lt;br /&gt;&lt;br /&gt;The libraries of which I speak are of the Javascript codebase variety that allow sophisticated user interfaces to be incorporated into web pages by even the most casual of coders and webmasters.&lt;br /&gt;&lt;br /&gt;Here's a good free one, called &lt;a href=&quot;http://dojotoolkit.org/&quot; target=&quot;_blank&quot;&gt;Dojo&lt;/a&gt;.  As their website says,&quot;Dojo lets you prototype interactive widgets quickly, animate transitions, and build Ajax requests with the most powerful and easiest to use abstractions available.&quot;&lt;br /&gt;&lt;br /&gt;There are many out there.&lt;br /&gt;&lt;br /&gt;So stop reinventing the wheel, and get going instead on offering that revolutionary new service of yours.</description>
  </item>
  <item>
    <title>Quick Amazon Direct URL Generator</title>
    <link>http://www.jamesraposa.com/index/2005/12/18#amazon_direct_link_bookmarklet</link>
    <description>I was tired of schlepping (spelling?) over to Amazon to re-familiarize myself with how to set up a direct url to a single product, so I created this little bookmarklet:&lt;br /&gt;&lt;br /&gt;&lt;a href='javascript:void(am_id=&quot;YourAmazonAffiliateIDHere&quot;);void(am_isbn=&quot;&quot;);void(am_id=prompt(&quot;Enter your Amazon affiliate id&quot;,am_id));if (am_id != null) {void(am_isbn=prompt(&quot;Enter the ISBN number of the book&quot;,am_isbn));if ( (am_isbn != null) &amp;&amp; (am_isbn != &quot;&quot;) ) {void(url=&quot;http://www.amazon.com/exec/obidos/redirect?link_code=as2&amp;path=ASIN/&quot; + am_isbn + &quot;&amp;tag=&quot; + am_id);  void(prompt(&quot;Here is your direct Amazon url, courtesy of JamesRaposa.com\n(Ctrl-C to capture it)&quot;,url));}}'&gt;Create Amazon Url&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It works as is, by clicking on it, or just left-click on it and drag it up to your browser's toolbar and it will be saved there for whenever you need it.&lt;br /&gt;&lt;br /&gt;Once it's on the tool bar, right-click on its icon and left-click on the Properties menu selection.&lt;br /&gt;&lt;br /&gt;When that comes up, you just have to change where it says &quot;YourAmazonAffiliateIDHere&quot;, to be your actual Amazon affiliate id.&lt;br /&gt;&lt;br /&gt;Happy Holidays!</description>
  </item>
  </channel>
</rss>