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
Solved

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

Posted on 2016-10-30
1
128 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 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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

808 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