Solved

Getting dynamic value from 3rd party page and passing to a function on another page

Posted on 2016-10-30
1
108 Views
Last Modified: 2016-10-30
I'm trying to figure out how to grab the PDV_n9559649 value when a sample 3rd party URL is hit:

https://polldaddy.com/n/413dd20f300b3fe5532c4c3b08bf9684/9559649?1477900000003

and renders the following:

PDV_n9559649='c3312b14d3|945';PD_vote9559649(0);

But trying to read into a JS function on my page somehow? Is that even possible with some type of callback function? If not what other alternatives do I have?
0
Comment
Question by:894359
1 Comment
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 41866198
No it's not possible to do this on the client (possible security risk and so it is outlawed).  You will need to do this on the server.  As that URL does not return JSON it's not possible to use jsonp (a cross site scripting workaround)

XMLHttpRequest cannot load https://polldaddy.com/n/413dd20f300b3fe5532c4c3b08bf9684/9559649?1477900000003. No 'Access-Control-Allow-Origin' header is present on the requested resource.

Therefore you should use a server side language (such as PHP) to request that URL via cURL or file_get_contents and return that to your page.

You can return that to your page using AJAX
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question