79119546

Date: 2024-10-23 20:07:46
Score: 1
Natty:
Report link

This reruns load function without showing params in browser url

function rerun() {
  $page.url.searchParams.set('player2', 'Jabami')
  fetch($page.url)
}

Alternatively there is a form action 'GET' request that can add searchParams in the url (visible in browser)

<form action="/game">
    <label>
        Search
        <input name="q">
    </label>
</form>

Type in the input and press enter, it will trigger search params and load function Use method='POST' in form to trigger an action The 'GET' rerun is at the bottom of this link https://svelte.dev/docs/kit/form-actions

Reasons:
  • Blacklisted phrase (1): this link
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Samexam