|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have been searching the internet for a script that checks the url in a popup window every 2 seconds, it shall be noted that the url isn't from the site where the script is, but a external. And then, if the url in the window changes, it should perform an action on the "script"-site, the action is to run a php function. It may sound a bit confusing, but just ask if something isn't clear enough, and i will explain. I hope someone can help me, thanks
|
|
#2
|
|||
|
|||
|
Modern browsers prevent you from accessing the location of frames and popups that are not located on your server.
|
|
#3
|
|||
|
|||
|
I know it can be done, i'm just not sure about the way to do it. On http://www.komogvind.dk you earn points by playing online games OR filling out leads. The leads open in a new window, and when you have completed filling out the forms and posted it, then komogvind.dk registers the points to you.
|
|
#4
|
|||
|
|||
|
All of those files are on the same server, or are on the same network/serverer farm, thus they are able to interact. That site does not use JS to find out what page the user is on. To do what that sites does you will have to use a server-side script to access a DB. Most modern browsers deny permission to access the location of a frame or window, sometimes even when the location in on the same server. So, NO this cannot be done as you are asking.
|
|
#5
|
|||
|
|||
|
<script type="text/JavaScript" language="JavaScript">
a = null; url = "url2"; function vispopup(adresse) { a = window.open(adresse, "a", ""); window.setTimeout("check('" + adresse + "');", 5000); } function check(adresse) { if (a != null) { if (a.location.href != url) { alert("the"); } } setTimeout("check('" + adresse + "')", 1000); } </script> <a href="#" onclick="vispopup('url1');return false">click here</a> -------------------------------------------------------------------------- it can be done |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|