如何使用外部JSON ...? [英] How do I use external JSON...?

查看:146
本文介绍了如何使用外部JSON ...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

花了几个小时试图找出这一点,但不能为我的生活弄清楚出了什么问题。

spent a few hours trying to figure this out, but cannot for the life of me figure out what's going wrong.

我想做的是加载这是:

https://recruit.zoho.com/ats/EmbedResult.hr?jodigest=2cV.Sr2As6VxhLMxQGuTNij*g.Fb3J7ysduDs.AC9sU-&atslocale=en_GB&rawdata=json

我相信是json javascript / jquery或php并使用数据。

which I believe is json, into either javascript/jquery or php and use the data.

我研究过jsonp,接着一些教程,使用一些演示作为模板,只是无法获取上述数据工作。

I've looked into jsonp, followed some tutorials, used some demos as templates and just can't get the above data to work.

如果任何人可以散发一些光,这将是非常感谢。这真的不应该是这么复杂,但我不知道是怎么回事。

If anyone can shed some light it would be much appreciated. It really shouldn't be this complicated, but I don't know what's going wrong.

推荐答案

是的,网站可能不支持JSONP,因此您必须使用PHP来执行此操作。

Yep, that's JSON. The site may not support JSONP, so you're gonna have to use PHP to do this.

这是未经测试的,但应该可以正常工作。

This is untested, but should work.

<?php
$url = 'https://recruit.zoho.com/ats/EmbedResult.hr?jodigest=2cV.Sr2As6VxhLMxQGuTNij*g.Fb3J7ysduDs.AC9sU-&atslocale=en_GB&rawdata=json';
$JSON = file_get_contents($url);

// echo the JSON (you can echo this to JavaScript to use it there)
echo $JSON;

// You can decode it to process it in PHP
$data = json_decode($JSON);
var_dump($data);
?>

这篇关于如何使用外部JSON ...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆