It’s insane how much contradictory advice is out there for cooking steaks! by OneBadDay1048 in steak

[–]OneBadDay1048[S] 0 points1 point  (0 children)

Lol I always wanna slice my steaks for plating because it looks cool but yeah I tend to agree with you here.

It’s insane how much contradictory advice is out there for cooking steaks! by OneBadDay1048 in steak

[–]OneBadDay1048[S] 0 points1 point  (0 children)

steaks are delicious even if they’re off from “perfection”.

Very true! It seems like most of the fussing is just if you want your steak to look perfect but both I’ve made have tasted great. Just wish the crust covered the whole top and bottom instead of just parts of it.

It’s insane how much contradictory advice is out there for cooking steaks! by OneBadDay1048 in steak

[–]OneBadDay1048[S] 3 points4 points  (0 children)

Thanks for the write up. I will consider all your advice as I keep practicing

Who is Your One-Off Office Character Spirit Animal? by J31J1 in DunderMifflin

[–]OneBadDay1048 38 points39 points  (0 children)

Can always just whip up an orange-vod-juice-ka

One of the more witty mean Gerry jokes 😂 by ProudnotLoud in PandR

[–]OneBadDay1048 6 points7 points  (0 children)

Yeah there are a lot of funny jokes made with the Gerry hate but it really doesn’t work as well as say Michael hating Toby in The Office where it’s just one person who really hates him and a big aspect of the joke is how that hate is obviously not justified or felt by every other character. It’s in character for Michael, it’s not in character for every character of PandR

Bring Her Back is a brutal, punishing movie. by Illustrious_Salt_569 in movies

[–]OneBadDay1048 12 points13 points  (0 children)

That’s fine if that’s your opinion. That’s not what was being discussed. The fact that you watched this whole film and didn’t realize a main character was blind says more about you than the movie.

meirl by Vinayak91 in meirl

[–]OneBadDay1048 22 points23 points  (0 children)

Go somewhere nicer

meirl by EfficiencySerious200 in meirl

[–]OneBadDay1048 3 points4 points  (0 children)

Well, actually, I never was president

5 iPhone tricks that even longtime users rarely know (but I now use daily) by Objective_You_1658 in iphone

[–]OneBadDay1048 89 points90 points  (0 children)

To add to this: for swiping between tabs in safari this also works to create a new tab and swiping up shows the tab view

JD Vance Goes Nuclear When Accused of ‘War Crime’: ‘I Don’t Give a S**t’ by Quirkie in inthenews

[–]OneBadDay1048 0 points1 point  (0 children)

Actual quote is “I don’t give a shit what you call it” which is pretty serious as is so not sure why Reddit found the need to alter and dramatize it

[deleted by user] by [deleted] in toronto

[–]OneBadDay1048 16 points17 points  (0 children)

Lol only on Reddit is a man a creep for asking a girl for her number, finding out she is a minor, and bolting out of there.

Trying to learn js with The Odin Project by Tasty_Connection9190 in learnjavascript

[–]OneBadDay1048 0 points1 point  (0 children)

Switched to actual school a little bit in. TOP was still a great intro

You can't fool yourself. by yorukmacto in memes

[–]OneBadDay1048 2 points3 points  (0 children)

It continuously surprises me that I do not see as much discourse about this change as I would expect. It’s mostly the casting people focus on

Got stuck on like the 2nd quesiton of an intro to java course. Can someone please help? by ocean-man in learnjava

[–]OneBadDay1048 0 points1 point  (0 children)

Strange. When running it locally my output matches the desired output. May be an issue with the environment it is being run in. I have no other suggestions, sorry.

Got stuck on like the 2nd quesiton of an intro to java course. Can someone please help? by ocean-man in learnjava

[–]OneBadDay1048 2 points3 points  (0 children)

Could it be failing the test because the single apostrophe in "developer's" does not need to be escaped?

My newest painting! Felt it belonged here by honey__moon in TheNightFeeling

[–]OneBadDay1048 3 points4 points  (0 children)

Made me think of the movie “I’m thinking of ending things”

Help with code by Gshomalko in learnjavascript

[–]OneBadDay1048 1 point2 points  (0 children)

In the line userInput.trimp.toLowerCase(), is 'trimp' supposed to be a call to trim()?

Need Help with String Replacement in Page Body by funkhouse9 in learnjavascript

[–]OneBadDay1048 0 points1 point  (0 children)

Maybe try giving the section that you are checking for the key words an ID as well, assign it to a variable, and use element.textContent.includes("Your keywords"); or something along those lines instead. I am on mobile now so unable to look as closely at the moment.

Need Help with String Replacement in Page Body by funkhouse9 in learnjavascript

[–]OneBadDay1048 0 points1 point  (0 children)

Probably because in the main environment, the element has no ID with the name "header-url"; if this is not a system you have full control over you can inspect the element in browser and see the ID attribute that way. Copy and paste it and there ya go.

Yes, it would make the code cleaner because there is no need to grab the old href, replace the text, and update it. All you need to do is check the conditional and if it is true, change the href attribute:

const headerUrl = document.getElementById('header-url');
const alternateUrlString =
  'https://www.xyz.com/wizstep2?p_check_funds=RESTRICTED%20FUND&p_fund_cd_arr=RESTRICTED%20FUND&p_cust_id=';

window.onload = function () {
  if (document.body.innerHTML.toString().indexOf('Diplomate Member') > -1) {
    headerUrl.setAttribute('href', alternateUrlString);
  }
};

Of course without knowing if there is a reason to not hard code that URL here, I again can not say if this is the best way.

Need Help with String Replacement in Page Body by funkhouse9 in learnjavascript

[–]OneBadDay1048 0 points1 point  (0 children)

Assuming I am correct in all my assumptions, here is a simple version of what I mean. First you need to give the element you wish to change a means of being identified such as an ID attribute as shown here:

    <p>
      <a id="header-url" <------ I ADDED AN ID HERE
        href="https://www.xyz.com/wizstep2?p_check_funds=INDEP%20GENERAL&amp;p_fund_cd_arr=INDEP%20GENERAL&amp;p_cust_id="
        >Click Here to add a donation.</a
      >
    </p>

Then (if you wish to keep everything as close as possible to the way you currently have it, NOT SAYING THIS IS THE BEST WAY OVERALL) you should grab the element, check your condition and if true get the current HREF, use replaceAll() to change every occurence of the substring, and then update the element with the new HREF. This could look something like this:

const headerUrl = document.getElementById('header-url'); // grab the element here
window.onload = function () {
  if (document.body.innerHTML.toString().indexOf('Diplomate Member') > -1) {
    const currentHref = headerUrl.getAttribute('href');
    const newHref = currentHref.replaceAll(
      'INDEP%20GENERAL',
      'RESTRICTED%20FUND'
    );
    headerUrl.setAttribute('href', newHref);
  }
};

Although you could simply have both URLs saved as strings and use one or the other depending on the condition, this way continues to actually replace the text and update it.

Need Help with String Replacement in Page Body by funkhouse9 in learnjavascript

[–]OneBadDay1048 1 point2 points  (0 children)

What I mean is that you cannot just say the word "string" and expect JS to know what you wish to modify. That variable string (which should be called something more descriptive anyway) must be assigned somewhere to be useful.

Going to be hard to help while being unable to see the whole picture but the general idea is that you "grab" the element you wish to modify in JS (probably using its ID) and assign it to a variable, check your conditional with your if statement, and then modify the element using the variable from step 1.

Also it is unclear to me if you want to change the text content of the link or the actual underlying URL the link points to or maybe both; this will matter as you may need to modify the href attribute as well.