Is it possible to have code remain but serve no purpose for now?

Discussion in 'PHP' started by kyrogenic, Dec 27, 2007.

  1. #1
    There are some lines in a site I just purchased that point to domains that dont have content currently. I will be resurrecting them soon, is there a way to keep the code, but not make it active until Im ready to use it again?

    Here is an example of some of the code

    <div id="Jasmine"><script language='JavaScript' type='text/javascript' src='http://xxxxx.org/ads/adx.js'></script>

    Is it possible to make it remain yet not working?
     
    kyrogenic, Dec 27, 2007 IP
  2. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could comment the lines out?
    If its pure html
    
    <!--<div id="Jasmine"><script language='JavaScript' type='text/javascript' src='http://xxxxx.org/ads/adx.js'></script>-->
    
    Code (markup):
    Note: this will still be visible inside the html page source.

    I assume you use php to output those lines, so the best way would be to comment them out on the server.
    If you have something like this:
    
    echo '<div id="Jasmine"><script language=\'JavaScript\' type=\'text/javascript\' src=\'http://xxxxx.org/ads/adx.js\'></script>';
    
    PHP:
    you just add two backslashes at the line beginning:
    
    //echo '<div id="Jasmine"><script language=\'JavaScript\' type=\'text/javascript\' src=\'http://xxxxx.org/ads/adx.js\'></script>';
    
    PHP:
    This is better, because the lines wouldn't show up at all in the html page source.

    Is this what you were looking for?
     
    hogan_h, Dec 27, 2007 IP
  3. kyrogenic

    kyrogenic Peon

    Messages:
    172
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So, I should change the direction of the slashes within the line and put //echo before it?
     
    kyrogenic, Dec 27, 2007 IP
  4. jronmo

    jronmo Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Will you be developing on the site you just bought or xxxxx.org?
     
    jronmo, Dec 27, 2007 IP
  5. kyrogenic

    kyrogenic Peon

    Messages:
    172
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    well, the site I will be making changes to, the xxxxx.org was a seperate banner hosting server for the site, which isnt up and running currently. I will be implementing that again sooner or later, currently though the site lags while its looking for the server, I want to get rid of the lag, but keep the code.
     
    kyrogenic, Dec 27, 2007 IP
  6. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yes, thats php code for comments // , but it works only inside php.

    echo was just example, you need to see how the original php code outputs those lines. Maybe it's echoing them (then you could comment those lines), maybe it's including them as pure html, etc., you need to see how it's done and then act accordingly.
     
    hogan_h, Dec 27, 2007 IP
  7. jronmo

    jronmo Guest

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Depending on the dependencies in the adx.js file you could make a local copy on the local server.
    If adx.js is getting banners from other servers you will still have lag. You could test each server and find which one has the slow response time.

    You could also use a hidden iframe to get the banners, so your page will still load while it is searching for the banner site.
    
    <iframe id="banner" src="xxxxx.org/page/with/banners" height="0" width="0" scrolling="no">
    <!-- this will call xxxxx.org server -->
    </iframe>
    
    <div id="banner">
      <a href="xxxxx.org/banner/link">
        <img src="xxxxx.org/banner/image" />
      </a>
    </div>
    
    Code (markup):
     
    jronmo, Dec 27, 2007 IP