These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

IGB and JSON

Author
Kivorno
Myanapa Corsica
#1 - 2014-10-12 10:28:09 UTC
Hi,

I'm trying to populate a dropdown menu by loading the data through an ajax call to json page.

Out of game it works without any hitches but ingame, the dropdown is not populated.

I've tried going back to an earlier version of Jquery but the issue is still the same.

I've looked at the log_server and found a reference to CreatePopupWidget be called everytime I click the dropdown.

Does anyone have any thoughts or hints as to what I might need to look for in order to get it working?

Thanks!

Proud creator and developer of Eve-Merchant / Eve-Merchant Sprint

Pete Butcher
The Scope
Gallente Federation
#2 - 2014-10-12 18:20:26 UTC
Kivorno wrote:
Hi,

I'm trying to populate a dropdown menu by loading the data through an ajax call to json page.

Out of game it works without any hitches but ingame, the dropdown is not populated.

I've tried going back to an earlier version of Jquery but the issue is still the same.

I've looked at the log_server and found a reference to CreatePopupWidget be called everytime I click the dropdown.

Does anyone have any thoughts or hints as to what I might need to look for in order to get it working?

Thanks!


If you're using jquery 2 downgrade to 1.

http://evernus.com - the ultimate multiplatform EVE trade tool + nullsec Alliance Market tool

Kivorno
Myanapa Corsica
#3 - 2014-10-12 19:12:09 UTC
Thanks for the reply, I am already using the 1.11 version of JQuery, I've gone down through various versions to 1.8 but still the issue is the same.

Proud creator and developer of Eve-Merchant / Eve-Merchant Sprint

Daimian Mercer
Deep Core Mining Inc.
Caldari State
#4 - 2014-10-14 13:27:44 UTC
Can you post a small sample of the JSON string returned? IGB is pretty picky like most older browsers when it comes to formatting. I have Tripwire using JSON returned strings for many things.

Creator of Tripwire mapping tool - EVE-O thread

Twitter | daimian.mercer@gmail.com

Kivorno
Myanapa Corsica
#5 - 2014-10-14 13:35:50 UTC
Below is the output of the json Daimian:

Quote:

[{"typeID":"0","typeName":"Please select a ship type..."},{"typeID":"324","typeName":"Assault Frigate"},{"typeID":"1201","typeName":"Attack Battlecruiser"},{"typeID":"27","typeName":"Battleship"},{"typeID":"898","typeName":"Black Ops"},{"typeID":"1202","typeName":"Blockade Runner"},{"typeID":"547","typeName":"Carrier"},{"typeID":"419","typeName":"Combat Battlecruiser"},{"typeID":"906","typeName":"Combat Recon Ship"},{"typeID":"540","typeName":"Command Ship"},{"typeID":"830","typeName":"Covert Ops"},{"typeID":"26","typeName":"Cruiser"}]

Proud creator and developer of Eve-Merchant / Eve-Merchant Sprint

Daimian Mercer
Deep Core Mining Inc.
Caldari State
#6 - 2014-10-14 13:43:46 UTC
Looks good...

Well, only thing else I can think of without seeing the code in action is are you setting the data type in the AJAX call to tell it to expect a JSON? This is usually done via jQuery AJAX option of " dataType: 'JSON' " OR setting the return header. I guess it is worth asking if you are doing JSON AJAX calls elsewhere in your code?

Creator of Tripwire mapping tool - EVE-O thread

Twitter | daimian.mercer@gmail.com

Pro TIps
Doomheim
#7 - 2014-10-15 02:02:13 UTC
I just went through the same exercise using jQuery 1.11 and the jQuery-ui 1.11 autocomplete widget. I had no problems; functionality is identical in current Chrome as well as in the IGB.

If you are passing the data you quoted directly to autocomplete as its source: argument, rather than washing it through some custom function, it might not understand what to do with the objects inside that array. Perhaps you can link your page or post additional context.