1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript Help Needed For Affiliate Ad code

Discussion in 'HTML & JavaScript' started by goldcash, Jul 28, 2012.

  1. goldcash

    goldcash Registered Member

    Joined:
    Feb 12, 2008
    Messages:
    92
    Likes Received:
    19
    Hello All,

    Below is a java script code provided by company. It will displays ad listings. What I need is when user clicks on a ad than ad will open as usual but with that I need another page to be opened.

    EX:
    1. I will place this code in my site www.mysite.com/result.html


    <script type="text/javascript">
    function getQueryStringVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split('&');
    for (var i=0;i<vars.length;i++) {
    var pair = vars.split('=');
    if (pair[0] == variable) {
    return pair[1];}}}

    ni_ad_client = "my id"
    ni_res_id = 2;
    ni_alt_url = "https://www.shmktpl.com/search.asp";
    ni_zc = getQueryStringVariable('zipcode');
    ni_str_state_code = getQueryStringVariable('statecode');
    ni_var1 = "";
    ni_display_width = 250;
    ni_display_height = 500;
    ni_color_border = "";
    ni_color_bg = "";
    ni_color_link = "";
    ni_color_url = "";
    ni_color_text = "";
    </script>

    2. When any of the ad is clicked another page should be opened simultaneously like www.mysite.com/thankyou.html


    Note: One click and two pages will be opened.



    I request all genius to help me.

    Thank you
     
  2. skrode

    skrode Junior Member

    Joined:
    Nov 13, 2011
    Messages:
    103
    Likes Received:
    16
    do you want that the ad page opens in new window and thank you page in current window?
     
  3. goldcash

    goldcash Registered Member

    Joined:
    Feb 12, 2008
    Messages:
    92
    Likes Received:
    19
    Usually ads open in new window only. Ok I need thank you page to be opened in the new window if not possible than no problem if it opens in current window.

    Thank you for replying, Please provide me solution.