Yikes!

Oh no, I like hammers.  To me, javascript is more like having a tooth 
pulled out via string attached to door while simultaneously getting a 
colonoscopy sans drugs, putting me in a physical position so that the tooth 
gets pulled out sideways.

I thought you had already suggested a wikitext/macro way to go about 
things, but my memory is brutal:  Eric Shulman suggested all kinds of 
goodies in this other thread 
<https://groups.google.com/forum/#!searchin/tiddlywiki/Charlie%7Csort:date/tiddlywiki/z4NFX1SZ-Q0/U1TaMzbMBgAJ>
.

Although a bit overwhelming to me at the time, I understand Eric's code 
better now (thanks to everybody here via various samples of code in various 
threads, with a special shout-out to Eric, Tones, and Felicia.  (Dang it, I 
know I'm forgetting somebody.  Regardless, hugs to all !)

Looking back at Eric's code, the only thing that turned me off was the part 
about using $:/info/url/search to capture the "context".  At the time, I 
felt that approach a bit messy if ever I want to add additional types of 
search criteria in the mix.

Now I'm thinking I could handle splitting multiple search criteria with 
wikitext, knowing just enough to be dangerous.

At the moment, it just doesn't feel like a fun exercise.  However, I am 
keeping that in my back-pocket for when I'm in the right kind of mood for 
that kind of brain age game.

Honestly, though: as much as I loath javascript, I'm not quite sure I'm 
loving the "look" of the wikitext (purely subjective, just how my old 
sponge works.)


On Tuesday, October 27, 2020 at 1:50:59 AM UTC-3, TW Tones wrote:
>
> Charlie,
>
> Looks like javascript is your hammer. To people who have a hammer 
> everything looks like a nail. 
>
> As mark said "wikitext/macros" are most likely easy. Just ask for what you 
> want to achieve and we can help. I am not keen to try and reverse engineer 
> your Javascript code (I am not fluent in) before I provide a tiddlywiki 
> solution.
>
> Regards
> Tones
>
> On Tuesday, 27 October 2020 09:47:28 UTC+11, Charlie Veniot wrote:
>>
>> G'day,
>>
>> Javascript and I have never gotten along, but once in a while I've got no 
>> choice have simply must surrender to it.
>>
>> Working on my Chromebook, when I get something working, I never think of 
>> making sure it works with other browsers.  Sure enough, I discovered today 
>> that some javascript in my TiddlyWiki doesn't work with Internet Explorer.
>>
>> Specifically, the offending bit of code: a call to URLSearchParams.
>>
>> Figuring that I want error-handling that simply/gracefully/quietly exits 
>> the code, I decided to wrap all of the code with "try" and "catch" 
>> processing (having just discovered that today).
>>
>> If anybody has any related experience and/or interesting/educative info 
>> to share: please please please ?
>>
>> Related snipit of code (from this TiddlyWiki's tiddler 
>> <https://intertwingularityslicendice.neocities.org/CJ_ProductReviews.html#%24%3A%2Fmacros%2Fcharlie%2Fgetstartupcontext.js>)
>>  
>> further below.
>>
>> Cheers !
>>
>> exports.run = function() {
>>         const queryString = window.location.search;
>> try {
>>         const urlParams = new URLSearchParams(queryString);
>>         const wikicontext = urlParams.get('context');
>>         var output = wikicontext;
>>
>>         if ( (output !== "OffGridding") && (output !== "HydroCutting")  && 
>> (output !== "Chromebook") ){
>>             output = "ProductReviews";
>>         };
>>           document.title = output;
>> }
>> catch(err) {
>>             output = "ProductReviews";
>> }
>>         return output;
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2c6a9e39-3c7a-48b1-b3d7-0808f31ad2c1o%40googlegroups.com.

Reply via email to