Post ProjectBuyersProgrammersFAQForumContactRSS
      MEMBER LOGIN
      SERVICES & FEATURES
  • Post a Project
  • Signup
  • Job Listings
  • Featured Projects
  • Certified Members
  • Top Programmers
  • Affiliate Program
  • RSS Feeds
  •    THE 20 LATEST PROJECTS
    Want Php & Css Expert
    Psd Slice
    Complex Php / Mysql Project #2
    Need Quick Fix For Html/css/js
    E-mail Blast Service
    Clone Affiliate Landing Page
    A Clone Needed Probook Site 2
    Rotomania
    Clone Of Mp3 Conversion Site
    Create A Wp Based Tubesite 3
    Seo / Typo3
    Vectorize A Logo
    Custom Cms
    Email Sniffer / Email Scrapper
    Magento 1.4.0.1 Giftcert Fix 2
    Redirect Urls 301
    Xcart Repeat Last Order
    Web Designer
    Website Design.
    Directory Submission Software
     
       POPULAR NEW PROJECTS
    Article Writing
    Content Submission
    Landing Pages
    Conversions
    Twitter
    iPhone Applications
     
    Project: javascript edit
    ID: 1260536969
    Bookmark and Share Post Similar ProjectManage Your Project

    PROJECT DETAILS
    Comments (0)
    Status: Closed (Chosen Programmer: kevinsz; Paid; Rated 10 out of 10)
    Budget: $50
    Created: 12/11/2009 at 8:09 EST
    Closed: 12/11/2009 at 10:17 EST
    Project Creator:
    wyatt12
    Rating: 10.00/10 (45 reviews)
    Rated 10 out of 10 for this project.
    Description: Hi,

    This current javascript does a pop under onclick from a random rotation of urls everytime our users clicks a login submit button. I need it NOT to be random. First time visitor presses onclick button, display url 1. Second time visitor clicks onclick load url 2, and so on up to end of our url list, then repeat. This way it is kind of setup as a "round robin" setup and a user is not show same advertisement every time they login. I'm pretty sure this is done by setting different cookies, but I'm not sure. Here is my current code.


    <script type="text/javascript">
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
    offset += search.length
    // set index of beginning of value
    end = document.cookie.indexOf(";", offset);
    // set index of end of cookie value
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }

    function resetcookie(){
    var expireDate = new Date()
    expireDate.setHours(expireDate.getHours()-10)
    document.cookie = "tcpopunder=;path=/;expires=" + expireDate.toGMTString()
    }
    function loadornot(){
    if (get_cookie('tcpopunder')==''){
    loadpopunder()
    var expireDate = new Date()
    expireDate.setHours(expireDate.getHours()+parseInt(popfrequency))
    document.cookie = "tcpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString()
    }
    }
    function loadpopunder(popunder, winfeatures){
    win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"",winfeatures)
    win2.blur()
    window.focus()
    }
    function open_win() {

    var popunder=new Array()
    popunder[0]="http://www.yahoo.com"
    popunder[1]="http://www.bing.com"
    popunder[2]="http://www.ask.com"
    popunder[3]="http://www.google.com"

    var winfeatures="width=1024,height=800,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"

    var popfrequency="always"

    if (popfrequency=="always"){
    resetcookie()
    loadpopunder(popunder, winfeatures)
    }
    else{
    if (get_cookie('tcpopunder')!=parseInt(popfrequency))
    resetcookie()
    loadornot()
    }

    }

    </script>

    Job Type: Javascript


    View Message Board for this Project Messages Posted: 9


    PROJECT BIDS
    Programmers Bid Delivery Time Time of Bid Rating  
    s3rvice $25 1 day 12/11/2009 at 8:22 EST
    10.00/10
    (2 reviews)
     
    pacex Certified Programmer $30 Immediately 12/11/2009 at 8:42 EST
    9.89/10
    (88 reviews)
    I am interested in working with you. Please check the PMB!
    kevinsz $30 2 hours 12/11/2009 at 8:34 EST
    9.85/10
    (55 reviews)
     
    see PMB
    maltasolutions $40 5 hours 12/11/2009 at 8:51 EST
    10.00/10
    (19 reviews)
     
    Hi, i can do this for you if you like. Hope to speak further on ways to implement the round robin technique. i have a few options
    nidhi $49 Immediately 12/11/2009 at 8:19 EST
    9.91/10
    (75 reviews)
    quality work
    akiles99 $50 Immediately 12/11/2009 at 8:18 EST
    9.44/10
    (177 reviews)
    Lets get started now...
    csajit $50 1 day 12/11/2009 at 8:13 EST
    9.52/10
    (70 reviews)
    I can do it for you...pls check pmb

    Related Projects:
    javascript research question javascript menu Javascript bracelet builder edit existing php script Marketing Writing Edit Rewrite
    More...


    Copyright © 2001 - 2010
    ScriptLance is a trade-mark of
    R3N3 International Inc
    Bookmark and Share
    Site MapRSSPrivacy PolicyTermsReport ViolationsAffiliatesFAQForumContact Support
    Graphic Design by: Graphicsguru.com