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

jQuery .ready Deprecated #2314

Open
sjpadgett opened this issue Mar 24, 2019 · 9 comments

Comments

Projects
None yet
5 participants
@sjpadgett
Copy link
Member

commented Mar 24, 2019

$( document ).ready(function() {
  console.log('*** No no ***');
});

Is no longer recommended especially jquery 3+. Also be aware calling onload bindings inside .ready will cause issues 3+.
Instead use:

$(function () {
  console.log('*** Use this instead ***');
 });

window.onload etc.

Possible issue for moderate to attack. If someone does take this on remember to not try to consolidate existing event handlers and leave in the same place in scripts workflow ie execution order can be important.
I've now come across this problem twice when updating jq dependencies to 3.1.1

@sjpadgett

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2019

Also href='javascript:void();' needs to be watched. It will break anchors if the function in onclick doesn't return false. Using javascript:void(0) will help but onclick makes it redundant either set up a click event in dom or use the href as meant e.g href="javascript: myWonderfulFunction(); return false;"
I just wanted to note here because I ran across new bug using divtoggle where href="#" was replaced with above which is probably more correct but needs a false return.
If someone wanted to explore, this would be worthwhile...

@sjpadgett

This comment has been minimized.

Copy link
Member Author

commented Mar 24, 2019

Another one that we needs to get done is go through code and make globals includes path reliable. Something like
require_once(dirname(__FILE__) . '/../../globals.php'); etc...

@danehrlich1

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

Another one that we needs to get done is go through code and make globals includes path reliable. Something like
require_once(dirname(__FILE__) . '/../../globals.php'); etc...

What are we currently doing?

Also @sjpadgett use backticks to quote code. Either enclose with a single backtick at beginning and end to do a oneliner like this or do 3 on top 3 on bottom to get something like this:

hello
three above
three below
hello
@danehrlich1

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

I assume this is for beginners so going to mark accordingly @sjpadgett

@danehrlich1

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

As always first-timers-only tag just means those who are newish to the repo. If you've been here less than 6 weeks and have only done 1 pull request say, feel free to contribute.

@sjpadgett

This comment has been minimized.

Copy link
Member Author

commented Mar 27, 2019

backticks to quote code
My Commodore doesn't have a tick :)

@jillpena

This comment has been minimized.

Copy link

commented Mar 28, 2019

Hi! Can I take on this issue?

@bradymiller

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

hi @jillpena ,
Definitely. There is also another developer working on this, @LightDev777 , but this is a big item and ok for more than 1 dev to work on it. Recommend just doing several scripts at a time until get the hang of it.

@bradymiller bradymiller added this to the 5.0.3 milestone Mar 29, 2019

bradymiller added a commit that referenced this issue Apr 5, 2019

Merge pull request #2359 from LightDev777/issue-2314-dated-reminders-…
…script

Issue #2314 - Updated deprecated dated_reminders scripts
@morg0n

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2019

Hey if you all have room for another Contributor I can push some things through!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.