Ok guy's i'm new with "Javascript", i decide to make vote script for all user's in xtremetop100.com
So here we go:
i trying make javascript function that check every 1 sec if iframe url is correct
So that's mean when i finish voting on that url, the javascript function will notice that iframe url is changed so
after iframe url is changed ( by voting ), then it will be show me message " Thank u for vote ".
Here is unploaded script , but it doesn't work: http://crystal-dekaron.zxq.net/
after 60 second's pass, vote will be disabled ( i made that function )
I tryed that scipt with "inneriframe", and it doesn't work, only shows alert after i load page, but i didn't vote and url didn't change
Because it isn't my vote , i just wanna prove that people vote
So i decide to make something like iframe
In iframe is a url from another site so i would make a script that check if iframe url is correct if not then that mean's that user voted!
Because iframe url change is they click on " vote button ".
Hello Preran, i want a make javascript. Here is following step(s)
1. Java Script that checking every 1 sec, if iframe url is changed!
So what is mean's?, I just create a iframe with a following url: http://xtremetop100.com/ but if someone click on any button in this iframe, then it will pm message or something like it.
But exactly what I wanted to say:
I got my game server.And I'm advertising it on xtremetop100 game's (site) , so i creating a script that checking if user votefor me. They will rective a coins ( ingame ), but how can
i know if someone vote for me, simple so the vote page is: http://www.xtremetop100.com/in.php?site=1132341231 ( in iframe ), so i made iframe size to 400 x 300 so other thing's won't be disabear on screen.
After it, if user click " Vote for Crystal Dekaron " ( my game ), iframe will be redirected to url http://www.xtremetop100.com/dekaron. After it i just asking people how can i make script if iframe url is changed!
Because i can't inspect source code's on this page so i decide to make javascript that check every 1 sec if user changed a iframe url
I hope you understand it. I'll add more pictures.
[xtremetop100.com isn't my website just using iframe to his site to prove if someone vote's for me]
The code would be something like:
var timeout;
function check() {
if(timeout != undefined) window.clearTimeout(timeout);
if(document.getElementById("inneriframe").contentWindow.location.href == "http://www.xtremetop100.com/dekaron") {
alert("Thanks for vote!");
} else {
timeout = window.setTimeout(check(), 1000);
}
}
Then you'd call it on body load:
<body onLoad="check()">
However in reality this would not work, because JavaScript is not allowed to access Window.location.href of an iFrame element due to the cross-domain security restrictions. Check the error it generates.
So you may need to explore other ways.
--
Kenneth Kawamoto
North America
Europe, Middle East and Africa
Asia Pacific