Pages: [1] :: one page |
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Tirestun
NOCXIUM DOGS
23
|
Posted - 2012.05.15 19:36:00 -
[1] - Quote
Hey all,
I'm a bit weak on JavaScript, so my apologies there, I'll try and muscle through the description of what I'm looking for, but bear with me here.
I need a script that will check a given API ID and Vcode's access mask, and if it returns a 'false' boolean value it won't allow them to hit the 'submit' button when registering. Really, I just need the chunk of code, or at least a brief explanation on how to pull that data via javascript and I should be able to figure the rest out myself.
If you've got a better solution, though, I'd love to hear it.
Many thanks; .tirestun |

Osku Rei
Black Aces Against ALL Authorities
7
|
Posted - 2012.05.16 09:13:00 -
[2] - Quote
frontend > ajax > backend > eve api.
So in your frontend (html page) do a Javascript ajax call to your backend (like a php file), this file does the API request and echos back back the xml response from the API; the ajax call then picks up with response and does stuff with it. Alternatively the php file could do the work/manipulate the xml and just return stuff that you need, in json/html for example.
I might be able to write up a small example later today.
Hope this helps. o/
P.s Your Javascript has to call your backend which then calls the API because Javascript doesn't allow Cross-domain-requests (same origin policy) Next generation of lottery tracker coming soon! http://evelotterytracker.com/
Please like my post if it has helped you :) |

Tirestun
NOCXIUM DOGS
23
|
Posted - 2012.05.16 13:30:00 -
[3] - Quote
It's a start, at least I know what I'll need to learn.
Thanks, mate. |

Khorkrak
War Tribe
2
|
Posted - 2012.05.17 02:37:00 -
[4] - Quote
It doesn't appear that fetching a url from some other site from within javascript is allowed due to XSS prevention: Can't Fetch a URL
Unfortunately you need to do so to get the API Key mask so that means you'll most likely have to go with AJAX and have your server code call the EVE API. Info on the EVE API method you need to call: API Key InfoThen simply parse the returned XML for the mask server side and return the value to your javascript. For example in Python with the given xml response string:
Get Access Mask Extraordinary claims require extraordinary evidence |

Osku Rei
Black Aces Against ALL Authorities
8
|
Posted - 2012.05.17 08:24:00 -
[5] - Quote
Tirestun wrote:It's a start, at least I know what I'll need to learn.
Thanks, mate.
Here's a very basic example:
HTML / Javascript (you'll need jQuery): http://pastebin.com/SyuhMLud
PHP: http://pastebin.com/NDZNP2a6
I would recommend doing a simple validation check such as this on the server side and then returning true/false to the front end (which would then be used to enable/disable the button), this will reduce your code and keep things centralised.
Hope that helps :) Next generation of lottery tracker coming soon! http://evelotterytracker.com/
Please like my post if it has helped you :) |

Tirestun
NOCXIUM DOGS
23
|
Posted - 2012.05.17 14:14:00 -
[6] - Quote
Good God, Osku, thank you!
I'll get to implementing this on the test side to make sure everything is kosher before going live. |

Osku Rei
Black Aces Against ALL Authorities
9
|
Posted - 2012.05.17 15:28:00 -
[7] - Quote
Tirestun wrote:Good God, Osku, thank you!
I'll get to implementing this on the test side to make sure everything is kosher before going live.
:) no problem, give me a shout if you need help. Next generation of lottery tracker coming soon! http://evelotterytracker.com/
Please like my post if it has helped you :) |
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |