Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove/update the old jQuery AJAX requests #267

Open
2 tasks
patrickmj opened this issue Jun 23, 2023 · 2 comments
Open
2 tasks

Remove/update the old jQuery AJAX requests #267

patrickmj opened this issue Jun 23, 2023 · 2 comments
Assignees
Labels

Comments

@patrickmj
Copy link
Member

patrickmj commented Jun 23, 2023

< 5 hours

A particularly notable example of old code, JS has better native tools for this lately.

Change all of the JQuery AJAX into something modern (probably native JS). This might be doable as you move through the other files.

  • find all the jQuery AJAX usages
  • modularize them into one coherent place
@eswarsaladi
Copy link
Collaborator

need to figure out a way to, modularize code, require keyword does not work in frontend code,
two possible solutions

  1. To use enque_scripts and add the code to the list
  2. To configure webpack

@patrickmj
Copy link
Member Author

Option 1, use enque_scripts is most likely the way to go. That's actually another whole area that's on my mind to refactor, but we can get there later. There's an example at https://github.com/NEU-Libraries/drs-toolkit-wp-plugin/blob/ceres-connection/drs-tk.php#L1169 . And the WP documentation for how it works. If you go that route, put the PHP near the top of drs-tk.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants