|
Hi
i am working on traffic exchange website need little help on two points.
When user click on surf button then it will get urls from DB and start showing them in popup window now the problem i am having is that how i can get next url from DB as i cant get all as there can be more then 10K+ and also next url should open in same popup and how to add points into user account after countdown to 0seconds.
|
|
|
|
|
Look into the .ajax method from JQuery, it will let you make an asychrnous call to get the next URL from the Db.
I don't know much about what technology you're using, but you could do something like this:
$(document).ready(function() {
$(#surf).click(function() {
setInterval(GetNextUrlAndDisplayIt, 1000);
});
});
function GetNextUrlAndDisplayIt() {
$.ajax(
{
url: 'UrlForGettingNextURL.aspx',
cache: false,
success: function(data) {
window.open(data, "myWindow")
}
}
Calling window.open and using the same name will mean it will open the next URL in the same window.
I'm making a few assumptions here, like that your "surf" button has the id "surf" and that your call to get the next URL returns just the URL and there's no parsing needed.
All in all that code should get you started.
EDIT: Obviously you will need to have some kind of way to know which URL you retreived last as well.
|
|
|
|