Question

Problem

I am not able to refresh the page with window.location.reload() which is used inside the success call made to yahoo.

Any hints how it can be fixed. The whole of the code is working fine it is making call to cse server getting contents from there saving on yahoo. but i have to manually refresh the page to bring the contents. I want it to be automatic so I used window.location.reload() but thats not working. Any suggestions how it can be done. The function below is actually a function for a button.

Was it helpful?

Solution

That's the problem, right there.

If your script is running from the CSE server's domain, you cannot send data to the yahoo server. This is javascript's main limitations. Likewise, if running off of the yahoo domain, you can send data to it, but cannot send data to the CSE server, unless it is part of the yahoo domain.

Would work: Get data from blahblahblah.yahoo.com, then send data to somedomain.yahoo.com

Would not work: Get data from blahblahblah.somesite.com and send data to somedomain.yahoo.com

Main point, if you're getting data from "csce.unl.edu" and running off of that domain (aka running your script in a browser window from that domain), you can only send data to a site that ends with ".unl.edu". So you can send or receive from "test.unl.edu", but not some yahoo site.

A solution: Host a proxy script on some webserver, or write all of your code in PHP. Here is two great references on what a proxy script is, and the second link actually provides one for you: Link 1 Link 2

Any more help needed, you can let me know, I had to set one up myself, on my server, and I can help you out if you run into problems.

OTHER TIPS

did you tried:

window.location = window.location;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top