Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript inside document.write

    Hello everyone,

    I have to write this html/javascript code inside document.write().

    Code:
    <table width="995" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
      <tr>    
        <td width="14" rowspan="3"><img src="/imagenes/publi/CintPubli_Vert_01.gif" width="14" height="100"></td>
        <td background="/imagenes/publi/SuperBanner_PxSup.gif"><img src="/imagenes/espacio.gif" width="728" height="4"></td>
        <td background="/imagenes/publi/SuperBanner_PxSup.gif"><img src="/imagenes/espacio.gif" width="4" height="4"></td>
      </tr>
      <tr>
        <td width="728"><script language="JavaScript" type="text/javascript">
    					ord=Math.random()*10000000000000000;
    					document.write('<script language="JavaScript" src="http://ad.es.doubleclick.net/adj/motociclismo.tsv/portada;sz=468x60;sect=;ptile=1;ord=' + ord + '?" type="text/javascript"><\/script>');</script><noscript><a 
    							href="http://ad.es.doubleclick.net/jump/motociclismo.tsv/portada;sz=468x60;sect=;ptile=1;ord=123456789?" target="_blank"><img 
    							src="http://ad.es.doubleclick.net/ad/motociclismo.tsv/portada;sz=468x60;sect=;ptile=1;ord=123456789?" width="468" height="60" border="0" alt="banner"></a></noscript></td>
        <td background="/imagenes/publi/Px_grisSB.gif"><img src="/imagenes/espacio.gif" width="253" height="4"></td>
      </tr>
      <tr>
        <td background="/imagenes/publi/SuperBanner_Pxinf.gif"><img src="/imagenes/espacio.gif" width="728" height="5"></td>
        <td background="/imagenes/publi/SuperBanner_Pxinf.gif"><img src="/imagenes/espacio.gif" width="4" height="4"></td>
      </tr>
      <tr bgcolor="#ffffff">
        <td colspan="3"><img src="/imagenes/espacio.gif" width="20" height="8"></td>
      </tr>
    </table>
    I have trying everything, but i am not able to make it work.

    Can someone please help me? Thanks in advance

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is what i tried, but it does not work. I canīt see the banner (js include) inside the <td>:

    Code:
    <script language="JavaScript" type="text/javascript">
    <!--
    function writeJS(){
    var str='';
    str+='<table width="995" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">';
    str+='  <tr>    ';
    str+='    <td width="14" rowspan="3"><img src="\/imagenes\/publi\/CintPubli_Vert_01.gif" width="14" height="100"><\/td>';
    str+='    <td background="\/imagenes\/publi\/SuperBanner_PxSup.gif"><img src="\/imagenes\/espacio.gif" width="728" height="4"><\/td>';
    str+='    <td background="\/imagenes\/publi\/SuperBanner_PxSup.gif"><img src="\/imagenes\/espacio.gif" width="4" height="4"><\/td>';
    str+='  <\/tr>';
    str+='  <tr>';
    str+='    <td width="728"><script language="JavaScript" type="text\/javascript">';
    str+='					ord=Math.random()*10000000000000000;';
    str+='					document.write(\'<script language="JavaScript" src="http:\/\/ad.es.doubleclick.net\/adj\/motociclismo.tsv\/portada;sz=468x60;sect=;ptile=1;ord=\' + ord + \'?" type="text\/javascript"><\/script>\');<\/script><noscript><a ';
    str+='							href="http:\/\/ad.es.doubleclick.net\/jump\/motociclismo.tsv\/portada;sz=468x60;sect=;ptile=1;ord=123456789?" target="_blank"><img ';
    str+='							src="http:\/\/ad.es.doubleclick.net\/ad\/motociclismo.tsv\/portada;sz=468x60;sect=;ptile=1;ord=123456789?" width="468" height="60" border="0" alt="banner"><\/a><\/noscript><\/td>';
    str+='    <td background="\/imagenes\/publi\/Px_grisSB.gif"><img src="\/imagenes\/espacio.gif" width="253" height="4"><\/td>';
    str+='  <\/tr>';
    str+='  <tr>';
    str+='    <td background="\/imagenes\/publi\/SuperBanner_Pxinf.gif"><img src="\/imagenes\/espacio.gif" width="728" height="5"><\/td>';
    str+='    <td background="\/imagenes\/publi\/SuperBanner_Pxinf.gif"><img src="\/imagenes\/espacio.gif" width="4" height="4"><\/td>';
    str+='  <\/tr>';
    str+='  <tr bgcolor="#ffffff">';
    str+='    <td colspan="3"><img src="\/imagenes\/espacio.gif" width="20" height="8"><\/td>';
    str+='  <\/tr>';
    str+='<\/table>';
    document.write(str);
    }
    writeJS();
    //-->
    </script>
    Any idea? thanks again

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can someone help me, please? I am still stuck.

    Thanks in advance

  • #4
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No ideas? I keep trying with this, but without any luck at the moment...please help.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The reason you may not be getting responses because this a request that makes absolutely no sense. Why must you use document.write? Explain that to us.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    The reason you may not be getting responses because this a request that makes absolutely no sense. Why must you use document.write? Explain that to us.
    he doesn't need to explain/justify himself, he just needs his question answered.

    the problem is writing the text for a script tag:

    Code:
       
    document.write(\'<script language="Jav...
    
    //needs to be like:
            document.write(\'<sc\' + \'ript language="Jav...
    
    //or possibly like:  (i got a little lost...)
            document.write(\'<sc' + 'ript language="Jav...
    you may or may not need to break up the end tags as well. probably not a bad idea...


    the contiguous, though quoted script tag is accidentally parsed by the browser as the place to start a new script, not just another string...

    hope this helps.
    Last edited by rnd me; 07-19-2007 at 07:57 AM.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by rnd me View Post
    he doesn't need to explain/justify himself, he just needs his question answered.
    You may think so but keep your opinions to yourself thanks. The reason I asked him to is because this really seems like an assignment. Usually assignments require that you HAVE to use something. So if this is an assignment, thanks for doing his homework for him.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is not an assignment, believe me. I just thought in document.write because i have no experience in javascript at all, but i can do it in any way.

    Thanks anyway, i will solve it sooner or later.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •