?
Solved

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

Posted on 2016-10-30
1
Medium Priority
?
193 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 43

Accepted Solution

by:
Rob earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…
Suggested Courses

850 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