code to set a select box option value as an object

You will not be able to store objects/arrays in the value attribute, however an option would be to use data-* attributes which supports json automatically with jQuery 1.4.3+ <select> <option data-value=”{“name”:”rajiv”,”age”:”40″}”>a</option> <option data-value=”{“name”:”mithun”,”age”:”22″}”>f</option> </select> And using .change() $(“select”).change(function(){ alert($(this).find(“:selected”).data(“value”).age); }); Example on jsfiddle

TinyMCE API v4 windowManager.open – What widgets can I configure for the body option?

After I beautified the minified version of tinymce, i found that these may be some of the body types for windowManager.open. I’m not sure how to use them all, as all this info was gathered through trial and fail. Since the documentation is really bad, no real info can be gathered. Also here’s a link … Read more

Is there a good in-browser code editor? [closed]

CodeMirror comes with support for 60+ languages, and addons that implement more advanced editing functionality (autocompletion, code folding, configurable key bindings, search & replace, linter integration etc.). A rich programming API and a CSS theming system are available for customizing CodeMirror, and extending it with new functionality. It has been developed since early 2007, has … Read more

decodeURIComponent vs unescape, what is wrong with unescape?

What I want to know is what is wrong with escape/unescape ? They’re not “wrong” as such, they’re just their own special string format which looks a bit like URI-parameter-encoding but actually isn’t. In particular: ‘+’ means plus, not space there is a special “%uNNNN” format for encoding Unicode UTF-16 code points, instead of encoding … Read more

jQuery get the id/value of element after click function

$(“#myid li”).click(function() { alert(this.id); // id of clicked li by directly accessing DOMElement property alert($(this).attr(‘id’)); // jQuery’s .attr() method, same but more verbose alert($(this).html()); // gets innerHTML of clicked li alert($(this).text()); // gets text contents of clicked li }); If you are talking about replacing the ID with something: $(“#myid li”).click(function() { this.id = ‘newId’; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)