JSON crossdomain communication with PHP file and a local javascript file

前端 未结 7 723
孤街浪徒
孤街浪徒 2020-12-21 15:47

I am a JSON newbie, but have good experience in PHP and javascript. The question is simple, and the answer might be simpler. I am having trouble sending data from the PHP fi

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-21 16:35

    You could run a php script on your own server if that is an option.
    This:-

    returned this:-

    object(stdClass)[1]
        public 'username' => string 'sniper' (length=6)
        public 'email' => string 'ajithsubramanian@gmail.com' (length=26)
        public 'firstname' => string 'Ajith' (length=5)
        public 'lastname' => string 'Ravi' (length=4)
    

    Does that put you on the right path? You could do an AJAX call to a script based on this on your server.

提交回复
热议问题