Linked Questions

0 votes
2 answers
871 views

I'm currently trying to parse a JSON from a data attribute but I'm getting an error: Uncaught SyntaxError: Unexpected token � in JSON at position 0 This is my code: jQuery( document ).ready( ...
Mr. Jo's user avatar
  • 5,311
1 vote
4 answers
875 views

I am happy that the html5 data attribute exists. I can write a simple string into html attributes and access them via jquery. But .... wouldn't it be nice to have more than a simple string? Is ...
guettli's user avatar
  • 27.6k
0 votes
2 answers
237 views

I have a habit of using lots of data tags, and then reading them one at a time in jQuery e.g. *html* <span data-group="1" data-item="2" data-user="abc" data-type="...
IGGt's user avatar
  • 2,797
587 votes
25 answers
301k views

The eval function is a powerful and easy way to dynamically generate code, so what are the caveats?
Brian Singh's user avatar
  • 6,742
267 votes
17 answers
414k views

I'm using the Javascript window.atob() function to decode a base64-encoded string (specifically the base64-encoded content from the GitHub API). Problem is I'm getting ASCII-encoded characters back (...
brandonscript's user avatar
4 votes
2 answers
4k views

My question basically is exactly like this question. I am just wondering, if there is a way to achieve this without jQuery. The following code does not work. I have also tried it with an array, but ...
Fay Boisam's user avatar
0 votes
1 answer
2k views

I have an array $myArray Array ( [0] => Array ( [Number] => 039 [Fruit] => Apple [Level] => Low [Names] => Array ( [6] =&...
jumpman8947's user avatar
1 vote
1 answer
2k views

Getting the error when trying to open the modal with product details after products were queried with help of ajax Error itself: Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<...
Vlad Ivanyk's user avatar
0 votes
1 answer
1k views

I am saving array of javascript objects in the html data attribute using JSON.stringify(). When I try to retrieve the data using jquery .data() function, I do not get deserialized array of javascript ...
suk's user avatar
  • 25
1 vote
2 answers
1k views

This is the HTML attribute: data-plugin-options="{'Enabled': true, 'StartAt': 30, 'EndAt': 65}" How can get the value of the keys by javascript by the key name? Such as 'StartAt' value.
George's user avatar
  • 83
1 vote
2 answers
695 views

I have figured out a way to do this, defining a variable inside a HTML attribute like this: div data-name=some_var id="component" Then from Javascript I can retrieve it: alert($("#component").data("...
lapinkoira's user avatar
  • 9,108
0 votes
2 answers
1k views

Following is my code and data is json array i want to pass in onclick method of Update button function populateData(data) { $(".studentPanel").show(); for (var i = 0; i < data....
vagish dixit's user avatar
1 vote
2 answers
73 views

This is my html ( in twig template ) <li id="{{folder.id}}" data-jstree='{"icon":"glyphicon glyphicon-tags", "type":"folder"}' ><a href="#">{{folder.name}}</a> I am trying to get ...
Keutelvocht's user avatar
0 votes
1 answer
306 views

This is a revolution slider button. I would like to get the "rs-26" from the data-actions attribute of a div. How can I get it using jQuery? data-actions="[{"event":"click","action":"jumptoslide","...
Samad's user avatar
  • 66
0 votes
2 answers
187 views

Basically I'm trying to pass an json-array via onclick to a function <button onclick='showAccountOverviewModal("<%= accounts[j].name %>", `<%= accounts[j].bills%>`)'> Click Me &...
Lenny Will's user avatar

15 30 50 per page