Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript I Need This Advert Javascript Code Help

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #151598
    CodeGraphics
    Participant

    How do I go about this. I client want to place a full website background advert on one of my blogs. How do design the background advert with css is not a problem. My problem is how to integrate the javascript codes he gave me.

    I thought ordinarily, the advert background image will have a simple html anchor link, but here is the lines of javascript codes he gave me instead.

      <script type="text/javascript">
      <!--
      zone = "8";
      pl = "691";
      url = "http://websiteurl.com";
      //--></script>
      <script type="text/javascript" src="http://websiteurl.com/show.js"> </script>
    

    The show.js contains these codes:

    if (!c_text1) var c_text1 = 0;
    if (!c_text2) var c_text2 = 0;
    if (!c_text3) var c_text3 = 0;
    if (!c_text4) var c_text4 = 0;
    if (!c_text5) var c_text5 = 0;
    if (!c_text6) var c_text6 = 0;
    if (!c_text7) var c_text7 = 0;
    if (!c_text8) var c_text8 = 0;
    if (!c_text9) var c_text9 = 0;
    if (!c_text10) var c_text10 = 0;
    if (!c_border) var c_border = 0;
    if (!c_background) var c_background = 0;
    if (!page_background) var page_background = 0;
    if (!zone) var zone = 0;
    if (!pl) var pl = 0;
    if (!shape) var shape = 0;
    if (!ad_type) var ad_type = 0;
    if (!w) var w = 0;
    if (!top_space) var top_space = 0;
    if (!charset) var charset = 0;

    document.write(‘<s’+’cript language=”JavaScript” src=”‘+url+’/show.php?z=’+zone+’&w=’+w+’&pl=’+pl+’&ad_type=’+ad_type+’&charset=’+charset+’&top_space=’+top_space+’&shape=’+shape+’&c_border=’+c_border+’&c_background=’+c_background+’&page_background=’+page_background+’&c_text1=’+c_text1+’&c_text2=’+c_text2+’&c_text3=’+c_text3+’&c_text4=’+c_text4+’&c_text5=’+c_text5+’&c_text6=’+c_text6+’&c_text7=’+c_text7+’&c_text8=’+c_text8+’&c_text9=’+c_text9+’&c_text10=’+c_text10+’&code=’+new Date().getTime()+'”></s’+’cript>’);

    //document.write(url+’/show.php?z=’+zone+’&w=’+w+’&pl=’+pl+’&ad_type=’+ad_type+’&top_space=’+top_space+’&shape=’+shape+’&c_border=’+c_border+’&c_background=’+c_background+’&c_text1=’+c_text1+’&c_text2=’+c_text2+’&c_text3=’+c_text3+’&c_text4=’+c_text4+’&c_text5=’+c_text5+’&c_text6=’+c_text6+’&c_text7=’+c_text7+’&c_text8=’+c_text8+’&c_text9=’+c_text9+’&c_text10=’+c_text10);

    Or you can view the show.js properly here: http://www.ctrlshiftstudios.com/show.js

    Please I need this help.

    #151608
    __
    Participant

    I’m not sure what your question is. Integrate the Javascript with what? Why are you showing us all this code? What “background image”?

    Where did this code come from? I would suggest asking them what to do with it.

    #151624
    Alen
    Participant

    Including 3rd party script from some advertisers on your website, without clear explanation how to do it… potential for disaster.

    And this:

    document.write('<s'+'cript language

    why? s+c

    what?

    Why are variables defined outside the show.js, then you’re making a request to include the rest.. why not just define everything as is, instead of “dynamically” assigning/loading it.

    #151634
    __
    Participant

    why? s+c

    so the browser doesn’t automatically parse it as an actual <script> tag – yes, this happens, though it’s more of a problem with the closing tag.

    Including 3rd party script from some advertisers on your website, without clear explanation how to do it… potential for disaster.

    Agreed. But third-party js is a “potential disaster” no matter what. : )

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.