Solved

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

Posted on 2016-10-30
1
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 43

Accepted Solution

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

Independent Software Vendors: 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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
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 viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

687 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