Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

fix: remove undefined variable in staticman.js #256

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

VincentTam
Copy link
Collaborator

Description

The err variable in the current Staticman JS script is undefined, as my correspondence with Ricardo Fusari reveals.

Motivation and Context

The error-handling function with the error argument comes from jQuery's ajax() method. Due to @pacollins' plan to remove jQuery from the dependencies, I submitted #245 to refactor the form submission using XHR objects.

To log XHR errors, one may use myXHRobj.addEventListener('error', handleEvent) with custom JS function handleEvent(). As far as I know, few users would interest

function handleEvent {
  console.error(`${e.type}`);
  // render localized error message in HTML
}

Interested tech guys would find a way to get errors. Others might hardly need this err object

Screenshots (if appropriate):

[You can use Windows+Shift+S or Control+Command+Shift+4 to add a screenshot to your clipboard and then paste it here.]

Checklist:

  • I have updated the documentation, as applicable.
  • I have updated the theme.toml, as applicable.

@VincentTam VincentTam self-assigned this May 25, 2021
@VincentTam
Copy link
Collaborator Author

screenshot of error
An screenshot illustrating the error after merging current master at d2603d7 into my demo & test site VincentTam/hugo-future-imperfect-slim@586c9c2 and switching from Utterances to Staticman.

@VincentTam VincentTam merged commit d4da003 into pacollins:master Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant