Search the Community
Showing results for tags 'json'.
-
I take in json data that I want to go through and use the fields that I need. Data looks like this { "Part1": { "Field_1": { "Type": "", "Name": "", "special": "" }, "Field_2": { "Type": "", "Name": "", "special": "" }, "Field_3": { "Type": "", "Name": "", "special": "" }, "Field_4": { "Type": "", "Name": "", "special": "" }, "Field_5": { "Type": "", "Name": "", "special": "" }, "Field_6": { "Type": "", "Name": "", "special": "" }, "Field_7": { "Type": "radio", "Name": "RadioDefault", "special": "for" }, "Field_8": { "Type": "radio", "Name": "RadioDefault", "special": "for" }, "Field_9": { "Type": "radio", "Name": "RadioDefault", "special": "for" } }, "Part2": { "Field_1": { "Type": "", "Name": "", "special": "" }, "Field_2": { "Type": "", "Name": "", "special": "" }, "Field_3": { "Type": "", "Name": "TargetID38", "special": "rows=\"2\"" }, "Field_4": { "Type": "", "Name": "", "special": "" }, "Field_5": { "Type": "", "Name": "", "special": "" }, "Field_6": { "Type": "", "Name": "", "special": "" } } } I've parsed the whole json into an object certElementData = Object.entries(JSON.parse(result)); And tried to loop through the data. Getting unlucky here. Maybe I should go back to simple for loops but I want to try out the for in and for of loops. For of loops do well until I get to the Field_'s part as that refuses to go into a array and stays being an object. If I try to use a for in loop, that loop will wipe any following data, saying that sure it'll now loop through to Field_9 but that's it, there's no data after it. How can I retain all the data yet get to the bottom info such as "Name":"" and "Type":"" that I need. Have a look at the initial start parse as well. What if I'm needlessly parsing them and made a mistake at the start? Thanks.
-
So I have a form, using some radio buttons for mutually exclusive selection. Radio buttons are great as I can simplify code (basically not write any code for it) as they do exclusivity automatically. All is great except field serialization. I send off my form data, it saves the radio fields under a single name by which they are all grouped under, I can't give each a unique name otherwise their radio function stops working. Problem is, if I have 3 choices the only serialized data might be: "flexRadioDefault":"1" ...good luck me finding out which one of the 3 was selected. My only brainstorm solution is to actually send off the button ID inside the "value" which I could reference later? Instead of "1" here could be "flexRadioDefault":"ID1 to 3." For documentation and form loading. What would be the best way to sort this out? Am I good to try and figure out how to cross reference which radio button was selected with sending the ID inside value or am I overcomplicating things not aware that there's an easy solution?
- 5 replies
-
- html
- javascript
-
(and 2 more)
Tagged with:
-
Hi guys, me need help. I dont know how did it my idea. So 1. If rainmeter can make elements transparent, can it make this like burger-menu? This is to animation element, right? 2. I dont understand what language used for work Rainmeter, just thinking what its css, or js, or simple bat.file, BUT! 3. Me needed when i hover the mouse for icon (take this tag #menu) his opened more elements like are burger menu on the something web site, then user can be change icons from the available elements which one is for him need, and then he click for this element -- opened program (like it worked with *HoneyComb), or other icon hide back on the #menu I really dont understand HOW it maked, but really dlikes did it. Please help me for writing code for this, or founding how me did it
-
- rainmeter skin
- css3
-
(and 2 more)
Tagged with:
-
Basically i really only want the search bar to be black with any given theme... however that seems difficult (windows dark mode does this, but i cant stand it so i need another way) So i tried with this https://www.themebeta.com/chrome-theme-creator-online.html its pretty neat... but it doesn't actually let you change the search bar color for some reason...? But, they have an "example json file" at the bottom... So my question is, how do i access the json file from the theme i made or any other possibly...? I somehow need to decode the file to get to the actual json file, Im guessing, so how do i do that? Also if there are easier methods, like registry or whatever, ill take that too, i just want my black search bar back... Also note: there are definitely themes on the web store that have a black search bar, so it *is* possible (and also the theme "core 2" that i use also had a black search bar for the last two years...) the question is just how and editing the json file, to my limited understanding seems to be my best bet.
-
so here is the schema:for the json: { "ts": 1677330162, "uuid": "75e4917d-69cd-49e1-963f-380ea031a88b", "moderators": [ { "userId": 000001, "timeAdded": 1677332262, "permissions": { "all": true, "tag": true, "mail": true, "posts": true, "access": true, "config": true, "analytics": true } } ], "lastUpdated": 1677332262 } which is stored as i have tried all of these queries: https://stackoverflow.com/questions/38797627/query-a-json-column-with-an-array-of-object-in-mysql and nothing is working, mysql doesnt give an error, just no results. my last query i tried: SELECT * FROM community__sharded WHERE data->'$.moderators.*.userId' = json_array(000001); i have no idea where im going wrong, can i get some help?
-
Hello. So I got this json string that can be what ever big. {"profiles":[{"profileId":"9c1b46db-652f-4f4c-8879-0032dae374fe","userId":"9c1b46db-652f-4f4c-8879-0032dae374fe","platformType":"uplay","idOnPlatform":"9C1B46DB-652F-4F4C-8879-0032DAE374FE","nameOnPlatform":"Anfi."},{"profileId":"9c6c974b-3bf9-4424-b718-33787d5ea887","userId":"9c6c974b-3bf9-4424-b718-33787d5ea887","platformType":"uplay","idOnPlatform":"9C6C974B-3BF9-4424-B718-33787D5EA887","nameOnPlatform":"joveice"}]} Formated for easyer reading Object profiles:Array[2] 0:Object idOnPlatform:"9C1B46DB-652F-4F4C-8879-0032DAE374FE" nameOnPlatform:"Anfi." platformType:"uplay" profileId:"9c1b46db-652f-4f4c-8879-0032dae374fe" userId:"9c1b46db-652f-4f4c-8879-0032dae374fe" 1:Object idOnPlatform:"9C6C974B-3BF9-4424-B718-33787D5EA887" nameOnPlatform:"joveice" platformType:"uplay" profileId:"9c6c974b-3bf9-4424-b718-33787d5ea887" userId:"9c6c974b-3bf9-4424-b718-33787d5ea887" How do I get this into a database? so I know how the sql stuff works, but I need this thing "$obj->stuff->stuff->stuff" As I don't know how it will look for this and how to do a foreach or for with calculation
-
I need to create a JSON string from my database request do this code returns this : [{"id":"1","weight":"0"}][{"id":"2","weight":"7"}][{"id":"3","weight":"1.5"}] I need it to return [{"id":"1","weight":"0"},{"id":"2","weight":"7"},{"id":"3","weight":"1.5"}] (the commas instead of ][) How can I do this? <?php require 'dbConnect.script.php'; $query="SELECT * FROM `trash`"; if($is_query_run=mysql_query($query)){ while($query_execute=$query_execute=mysql_fetch_assoc($is_query_run)){ $rows = array(); $rows[] = $query_execute; print json_encode($rows); } } else{ echo "query notexecuted"; } ?>
-
Hey guys im trying to deduplicate a external json file the json file looks like this [{"id":1,"firstName":"Krisha","lastName":"Shenfisch", "city":"Zwolle"}, {"id":2,"firstName":"Ad","lastName":"Buesden", "city":"Hengelo"}, {"id":3,"firstName":"Wilma","lastName":"Dyerson", "city":"Enschede"}, {"id":4,"firstName":"Drew","lastName":"Chattelaine", "city":"Amsterdam"}, {"id":5,"firstName":"Esteban","lastName":"Beniesh", "city":"Amsterdam"}] now i want to make it so the it would not show the same city twice, i have no clue on how to do this im using js
-
Hello, I'm updating a project that I made a few years ago, and wanted to update some of the api responses and would really like your feedback on what a better response would be. So this small section displays races, I've formatted the response to make it easier to read. This is the old JSON response from the api: { "races": [ { "race_title": "test", "race_id": "1551", "race_desc": "I like big butts and I can't deny", "race_short_desc": "I like big butts and", "race_active": "true", "race_map": null, "race_image": null, "race_cover": "", } ], "count": 1 } And this is something that I just typed up: { "races":[ { "race_title":"", "race_id":"", "race_active":true, "extra":{ "race_desc":"", "race_map":{ "enabled": false, "src":"" }, "race_image":{ "enabled": true, "src":"" } "race_color":{ "enabled":false, "color":"rgba(255,255,255)" } } } ], "count":1 } I'm looking for a good way I could format the data to seem better. I was going to ask my friends *they exist I swear* however it's 3am and well, they're asleep and I'd rather have a more community response. Regards, Leon.
-
- 2 replies
-
- homekit
- homebridge
- (and 4 more)
-
I'm trying to get my Homebridge config file set up but I'm having issues. I have a feeling theres something basic im missing. Obviously I have no idea what I'm doing and any help would be greatly appreciated. Getting this error from json validators: { "bridge": { "name": "Homebridge", "username": "XX:xx:xx:xx:xx", "port": XXXXX, "pin": "xxx-xx-xxx" } , "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.", "platforms": [ { "platform": "TplinkSmarthome", "name": "TplinkSmarthome", "devices": "xxx.xxx.xxx", "platform": "Dafang", "mqtt": { "hostBroker": true, "debug": true, "mongoUrl": "mongodb://<dbuser>:<dbpassword>@xxxxx.mlab.com:xxxxx/homebridge-xxxxxxxxw/mqtt" }, "cameras": [{ "cameraName": "Bedroom", "cameraRTSPStreamUrl": "rtsp://xxx.xxx.x.xxx:xxxx/unicast", "mqttTopic": "SleepyHollow/Bedroom/#", "cameraName": "Living Rooom", "cameraRTSPStreamUrl": "rtsp://xxx.xxx.x.xxx:xxxx/unicast", "mqttTopic": "SleepyHollow/LivingRoom/#" } ] }
-
Hi, I'm trying to build a backend system using OCPP 1.6 JSON over websockets in Node. I am having some trouble with the whole websockets thing, I have experience with REST api's but this is throwing me for a loop. Essentially where I am at is that I receive a message from the charger like this: [2, "19223201", "BootNotification", {"chargePointVendor": "VendorX", "chargePointModel": "SingleSocketCharger"} ] I need to put this in a database which I can probably figure out myself, but more importantly I need to de-construct the message and generate an appropriate response. In this case it would look something like this: [3, "19223201", {"status":"Accepted", "currentTime":"2013-02-01T20:53:32.486Z", "heartbeatInterval":300} ] And I have no idea how to do it. Essentially I need a lot of if statements like if the massage has "BootNotification" in it, then send the accept message and if it has something else, then respond appropriately. If someone can help, I'll buy you a beer or coffee or beverage of your choosing? Edit: the documentation for the OCPP protocol is available here: https://www.openchargealliance.org/downloads/
-
Hi all, I am working on pulling data down from my server and have ran into a little issue and cant wrap my head around it. I have this script that generates a json output neatly but I want to expand it for when pulling multiple records down from my database. Right now the output looks like this: { "Testing01": { "name": "Scott", "number": null, "address": { "Line01": "123 fake street", "Line02": "Dublin", "Line03": "4", "Country": "Ireland" } } } But what I want to do is create a loop that will out put records like this: { "Testing01": { "name": "Scott", "number": null, "address": { "Line01": "123 fake street", "Line02": "Dublin", "Line03": "4", "Country": "Ireland" } }, "Testing02": { "name": "Mike", "number": null, "address": { "Line01": "321 fake street", "Line02": "Dublin", "Line03": "2", "Country": "Ireland" } } } If anyone at all can help me to create a method of printing nicely formatted json like the second example can you please share. Here is my code for the single output: <?php header('Content-Type: application/json'); $root = array( "Testing01" => array( "name" => "Scott", "number" => null, "address" => array( "Line01" => "123 fake street", "Line02" => "Dublin", "Line03" => "4", "Country" => "Ireland" ) ) ); echo json_encode($root, JSON_PRETTY_PRINT); ?> Thanks in advance.
-
So I am trying to make a script that will write a JSON file like this: And this is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using UnityEngine.SceneManagement; public class Statistics : MonoBehaviour { public Player player; public GameManager manager; public EnemyDeathCounter enemyDeaths; static float timeCounter; static int totalSpent; string path = "Assets/Statistics.json"; void Update() { totalTime(); endGame(); } void totalTime() { if(manager.gameInProgressInspector) { timeCounter += Time.deltaTime; } } void endGame() { if(player.playerDead == true || manager.gameCompleted) { // End game collectStatistics(); SceneManager.LoadScene("Leaderboard"); } } void collectStatistics() { statData statData = new statData(); string oldDataRaw = File.ReadAllText(path); statData oldData = JsonUtility.FromJson<statData>(oldDataRaw); //statData.username //DO USERNAME INPUT IN MENU CLASS statData.timeToComplete = timeCounter; statData.playerLevel = player.playerLevel; statData.armourLevel = player.armourLevel; statData.weaponLevel = player.weaponLevel; statData.totalMoney = player.totalMoneySpent; statData.enemiesKilled = enemyDeaths.count; statData.gameCompleted = manager.gameCompleted; statData.score = completedScore(calculateScore(statData.timeToComplete, statData.playerLevel, statData.armourLevel, statData.weaponLevel, statData.totalMoney, statData.enemiesKilled), statData.gameCompleted); string json = JsonUtility.ToJson(statData, true); File.WriteAllText(path, json); } int calculateScore(float timeToComplete, int playerLevel, int armourLevel, int weaponLevel, int totalMoney, int enemiesKilled) { if(totalMoney == 0 || enemiesKilled == 0) { // TotalMoney and/or enemiesKilled are 0 so need to be excluded int score = playerLevel * armourLevel * weaponLevel; if(totalMoney == 0 & enemiesKilled == 0) { // Both are 0 score = (score * 100)/Mathf.RoundToInt(timeToComplete); return score; } else if(totalMoney == 0) { // Just totalMoney is 0 score *= enemiesKilled; score = (score * 100)/Mathf.RoundToInt(timeToComplete); return score; } else if(enemiesKilled == 0) { // Just enemiesKilled is 0 score *= totalMoney; score = (score * 100)/Mathf.RoundToInt(timeToComplete); return score; } else { return 0; } } else { // TotalMoney and enemiesKilled are both bigger than 0 int score = playerLevel * armourLevel * weaponLevel * totalMoney * enemiesKilled; score = (score * 100)/Mathf.RoundToInt(timeToComplete); return score; } } int completedScore(int score, bool gameCompleted) { if(gameCompleted == true) { score *= 1; return score; } else { score *= 0; return score; } } private class statData { public string username; public float timeToComplete; public int playerLevel; public int armourLevel; public int weaponLevel; public int totalMoney; public int enemiesKilled; public bool gameCompleted; public int score; } } I have no idea how to make this work. If anyone has any ideas on how I could do this or even if I can do it a better way, they'll be greatly appreciated. Thanks!
-
I'm working with an API that has a weird way of doing arrays which I just can't understand how to convert to a C# array/list. Note: I'm using Newtonsoft.Json The JSON "array" looks something like this: Values : { "0": { "some data" }, "1": { "more data" }, "2": { "even more data" } } The thing is that the array itself isn't actually an array, its an object containing objects which have their name as array index and value their data... I don't get why the API was made this way, how you would handle this even in JavaScript For smaller arrays like this I did something like this, using JsonProperty in a way that I know: class Data { public string Value { get; set; } } [JsonProperty("0")] public Data Zero { get; set; } [JsonProperty("1")] public Data One { get; set; } [JsonProperty("2")] public Data Two { get; set; } public Data[] All { get { return new Data[] { Zero, One, Two } } } It works... kind of a hacky way of doing it, but some arrays are up to couple of thousand elements big and I have no clue if they are fixed or can expand in the future so this way of doing it is not practical at all. I have no control over the API, I can just fetch that data I have tried searching around if maybe there is a wildcard for the JsonPropertyAttribute name so that it can handle this kind of stuff but haven't found anything helpful or anyone else working with JSON of this type. Has anyone worked with something like this before and/or has an idea of how to handle this? Thank you in advance!
-
So we started using a CRM called Nutshell and everyone at the office is happy with it and is actually using it (FINALLY!) The only issue I have is when we go to create a new lead, person, or company there are some a few extra steps that are needed (on different pages) so while talking on the phone with someone it can take longer than we'd like. So, what I was thinking is I could write up a program (C++) that could integrate with the API. That way I can have a form that would have a few inputs so we can enter the new lead in with all the fields available on one screen and then send that to the CRM software with the ability to rotate leads between our sales guys evenly and also to integrate Google's Place Autocomplete API. This way when we're typing in an address it'll automatically lookup address to autofill the rest of the info. I just wanted to know if anyone else has had experience with using a JSON web API in a desktop application. I'd rather not waste a week of my time to find out there's going to be tons of code (like months worth of work) that would go into something like that. Thanks for any and all help/info you may have! Ryan
-
- crm software
- web api
-
(and 3 more)
Tagged with:
-
I'm trying to setup my config for Homebridge and I'm on JSONLint, but I'm not a coder. Could someone help me fix this? https://pastebin.com/iM9zYrQV
-
I'm attempting to design a small program that returns a specific value from an API. The API returns as a json file with all the values it provides however , there are a multitude of elements in that json , and i only need one ( 'round_duration') . I've installed the python requests library . I'm fairly new to python and programming in general, and i don't have much of a clue as how to do this , especially considering this is a nonstandard library ( although a fairly popular one ). My base code looks like this : import requests url = '<sample url>' a=requests.get(url) print (a.text) When i execute this scrypt, i get all the data in the json . However , i only need round_duration . I've looked online but i can't seem to find a clear answer to this Can anyone help with this?
-
I have a json data source as shown below. When I do =ImportJSON("*my url to the data source*", "/Schedule/Teams/teamNumber", "noHeaders") in google sheets, i only get a list of 2585, 4355. Those teams are the first "teamNumber" in each of the "Teams". How can I get the ImportJSON function in google sheets to result with all 12 team numbers, instead of just the first one in each team? { "Schedule": [ { "description": "Qualification 1 (C)", "field": "Primary", "tournamentLevel": "Qualification", "startTime": "2016-04-08T09:00:00", "matchNumber": 1, "Teams": [ { "teamNumber": 2585, "station": "Red1", "surrogate": false }, { "teamNumber": 3545, "station": "Red2", "surrogate": false }, { "teamNumber": 4610, "station": "Red3", "surrogate": false }, { "teamNumber": 3743, "station": "Blue1", "surrogate": false }, { "teamNumber": 57, "station": "Blue2", "surrogate": false }, { "teamNumber": 2950, "station": "Blue3", "surrogate": false } ] }, { "description": "Qualification 2 (C)", "field": "Primary", "tournamentLevel": "Qualification", "startTime": "2016-04-08T09:07:00", "matchNumber": 2, "Teams": [ { "teamNumber": 4355, "station": "Red1", "surrogate": false }, { "teamNumber": 6173, "station": "Red2", "surrogate": false }, { "teamNumber": 4328, "station": "Red3", "surrogate": false }, { "teamNumber": 4155, "station": "Blue1", "surrogate": false }, { "teamNumber": 5829, "station": "Blue2", "surrogate": false }, { "teamNumber": 3345, "station": "Blue3", "surrogate": false } ] } }
-
So I have some code def extract(soup, CONTINUE=True, FIRST_PAGE=True): tbody = soup.find("tbody") rows = tbody.find_all("tr", role="row") for row in rows: sub_rows = row.find_all("td") command = {} command["command"] = sub_rows[0].get_text() command["message"] = sub_rows[1].get_text() command["accessLevel"] = sub_rows[2].get_text() commands.append(command) next_button_li = driver.find_element_by_id("DataTables_Table_0_next") next_button_a = next_button_li.find_elements_by_tag_name("a") next_button_a[0].click() soup = BeautifulSoup(str(driver.page_source), "html.parser") if (soup.find("li", class_="paginate_button next disabled") is None and CONTINUE is True): extract(soup, FIRST_PAGE=False) elif (soup.find("li", class_="paginate_button next disabled") is not None and FIRST_PAGE is False and CONTINUE is True): extract(soup, CONTINUE=False, FIRST_PAGE=False) It has some more code but in all it goes & does its thing and returns in a file with [ { "message": "hello", "accessLevel": "everyone", "command": "!hello" }, { "message": "hi", "accessLevel": "everyone", "command": "!hi" } ] Do you know of a way I can add more "stuff": "stuff without pulling anything", I need it to look like this: [{ "command": "!hi", "group": "", "status": true, "runAsBot": false, "runAsUserElevated": false, "startsWithEx": false, "message": "hi", "lastUsed": "2016-01-23T02:51:02.4542456-08:00", "cooldown": 0, "accessLevel": 1, "soundFile": "", "costEnabled": false, "costAll": 0, "costVIPViewer": 0, "costVIPB": 0, "costVIPS": 0, "costVIPG": 0, "costVIPMod": 0, "costVIPStreamer": 0, "OnScreenWidgetEnabled": false, "OnScreenWidgetName": "", "OnScreenWidgetTitle": "", "OnScreenWidgetMessage": "", "OnScreenWidgetImageLink": "", "OnScreenWidgetAnimMode": 0, "OBSRemoteEnabled": false, "OBSRemoteAction": 0, "OBSRemoteSceneName": "", "CommandChaningCmdName": "", "CommandChaningRunAfter": 0, "CommandChaningRunAsAdmin": false, "VIPModEnabled": false, "VIPModIfViewer": 0, "VIPModIfVIPB": 0, "VIPModIfVIPS": 0, "VIPModIfVIPG": 0, "VIPModAddDays": 30, "countdown": "2016-01-22T21:59:40.053443-08:00", "counter": 8, "APITarget": false, "hideFromCmdList": true, "accessDeniedMsg": "", "noPointsMsg": "", "disableChanAccess": false, "disableWhisperAccess": false, "disableDiscordAccess": false, "isSoundVolumeSet": true, "soundVolume": 100 }, { "command": "!hello", "group": "", "status": true, "runAsBot": false, "runAsUserElevated": false, "startsWithEx": false, "message": "hello", "lastUsed": "2016-01-23T02:50:56.4220873-08:00", "cooldown": 0, "accessLevel": 1, "soundFile": "", "costEnabled": false, "costAll": 0, "costVIPViewer": 0, "costVIPB": 0, "costVIPS": 0, "costVIPG": 0, "costVIPMod": 0, "costVIPStreamer": 0, "OnScreenWidgetEnabled": false, "OnScreenWidgetName": "", "OnScreenWidgetTitle": "", "OnScreenWidgetMessage": "", "OnScreenWidgetImageLink": "", "OnScreenWidgetAnimMode": 0, "OBSRemoteEnabled": false, "OBSRemoteAction": 0, "OBSRemoteSceneName": "", "CommandChaningCmdName": "!cd5", "CommandChaningRunAfter": 1, "CommandChaningRunAsAdmin": false, "VIPModEnabled": false, "VIPModIfViewer": 0, "VIPModIfVIPB": 0, "VIPModIfVIPS": 0, "VIPModIfVIPG": 0, "VIPModAddDays": 30, "countdown": "2016-01-22T22:01:05.6060647-08:00", "counter": 14, "APITarget": false, "hideFromCmdList": false, "accessDeniedMsg": "", "noPointsMsg": "", "disableChanAccess": false, "disableWhisperAccess": false, "disableDiscordAccess": false, "isSoundVolumeSet": true, "soundVolume": 100 }] Thanks
-
I was watching a tutorial on how to make a chrome app/extension, and it was easy enough where I decided to make one for my two favorite websites, teksyndicate.com and linustechtips.com. Installing instructions below. ------------------------------ Known Issues The icon is not very high resolution. It was the best thing I could find. ------------------------------ Github Repository here ------------------------------ Installing Instructions 1. To install, download the project as a zip. Direct download link here. 2. In chrome, go to tools, extensions, then check developer mode. 3. Click, load unpacked extension. 4. Unzip the project. 5. Select "Linus Tech Tips Chrome App" folder, in the appropriate directory that you extracted the zip. It should be in the same directory as the ReadMe.txt file. 6. Install. That should do it! ---------------------------- Screenshots
-
Hello, I need help parsing a json string. Inside the getdata.php file: <?php $val1 = "break"; $val2 = "break2"; echo json_encode(array("name"=>$val1, "address" => $val2)); ?> Inside my data.js file: //1st method $('#btndata').on('click', function(){ $.post('getdata.php', function(e){ var obj = jQuery.parseJSON(e); <------- nothing happens when I click the button. $('#lbldata').html(obj.name); }); }); But if I type it this way: //Second method $('#btndata').on('click', function(){ $.post('getdata.php', function(e){ $('#lbldata').html(e); <----------- output in browser: {"name":"break","address":"break2"} }); }); What's puzzling here is when I used the first method in another project, it works. Can anyone help me sort this out? I even tried ajax and still got nothing. Thanks