My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 252: Use data-... attributes for all node options and remove `eval()` calls from code
4 people starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Oct 2013


 
Project Member Reported by moo...@wwwendt.de, Nov 24, 2011
Currently `eval()` is called to evaluate the `data`attribute.
This is considered evil (http://stackoverflow.com/questions/86513/why-is-using-javascript-eval-function-a-bad-idea) and not allowed in `strict` mode (http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/)

We can replace `eval()` with `jQuery.parseJSON()`
As a consequence, the definition of

    <li data="url: 'http://jquery.com'">jQuery home

is not valid JSON and has to be rewritten with double quotes as 

    <li data='"url": "http://jquery.com"'>jQuery home

Nov 24, 2011
Project Member #1 moo...@wwwendt.de
here's the patch.

Modifications of the markup may be a bit of a burden to users, so there should be a fallback or deprecation phase to ease migration
patch.diff
1.4 KB   View   Download
Dec 28, 2011
Project Member #2 moo...@wwwendt.de
Maybe this should go with using different `data-...` attributes instead of a single `data`.
Labels: -Type-Defect Type-Enhancement
Jan 11, 2012
Project Member #3 moo...@wwwendt.de
 Issue 269  has been merged into this issue.
Jan 25, 2012
Project Member #4 moo...@wwwendt.de
(No comment was entered for this change.)
Summary: Use data-... attributes for all node options and remove `eval()` calls from code
Jan 25, 2012
Project Member #5 moo...@wwwendt.de
See also  issue 276 
Jan 26, 2013
Project Member #6 moo...@wwwendt.de
(No comment was entered for this change.)
Labels: -Milestone-Release1.3 Milestone-Release2.0
Oct 6, 2013
Project Member #7 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Done
Owner: ---

Powered by Google Project Hosting