Results 1 to 3 of 3

Thread: how to add code from <head> to <body> tag?

  1. #1
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to add code from <head> to <body> tag?

    I would like to show links in particular body location.

    PHP Code:

    <html>

    <
    head>
    <
    title></title>

    <
    script type="text/javascript">
    <!-- 
    Begin

    var listName=''// the title of your list between single quotes
    var mpic=new Array();

    /* Edit link info in this order: name, image file, site title, URL
    Insert each info between single quote marks, followed by a comma
    (Replace '#' with the URL but leave the two quotes, i.e.
    'http://www.theURL.com')
    Do not edit after the URL. Add or remove lines as required */
    mpic[mpic.length] = new info('My products1''images/products/myimage1.jpg''My products1''html/product1.htm''m' mpic.length);
    mpic[mpic.length] = new info('My product2''euian.jpg''Hantojin''html/product2.htm''m' mpic.length);
    mpic[mpic.length] = new info('John''john.jpg''Radical Druid''#''m' mpic.length);
    mpic[mpic.length] = new info('Lillyanne''lilly.jpg''Astrodiva\'s Notebook''#''m' mpic.length);
    mpic[mpic.length] = new info('May''may.jpg''Shady Spot''#''m' mpic.length);
    mpic[mpic.length] = new info('Silk''silk.jpg''In the Realm of Senses''#''m' mpic.length);

    var 
    minArr=new Array();
    for (
    i=0i<mpic.lengthi++) {
    minArr[i]=new Image();
    minArr[i].src=mpic[i].thumb;
    }

    function 
    info(namthumbTitlewebmarkID) {
    this.nam nam;
    this.thumb thumb;
    this.Title Title;
    this.web web;
    this.markID markID;
    }

    function 
    codeIt() {
    document.write('<div id="hotlist"><b>' listName '<\/b>');
    document.write('<p width="100%" size="0">');
    for (
    j=0j<mpic.lengthj++) {
    document.write('<a target="offsite" href="');
    document.write(mpic[j].web);
    document.write('" onMouseover="preview(' ',\'' mpic[j].markID '\')">');
    document.write(mpic[j].nam);
    document.write('<\/a><span class="arrow" id="' mpic[j].markID '">&nbsp;&#9668<\/span><br>');
    }
    document.write('<br>');
    document.write('<div id="preview">');
    document.write('<img class="thumbnail" alt="" name="screenshot" src="' minArr[0].src '" onClick="dest()">');
    document.write('<div id="caption"><\/div>');
    document.write('<P><\/p>');
    document.write('<\/div><\/div>');
    /* --- Please attribute! The following line must appear --- */
    document.write('<P style="text-align:center; font-size:12px"><\/p>');
    }

    function 
    preview(t,a) {
    unmarkAll();
    document.getElementById(a).style.visibility='visible';
    document.getElementById('preview').style.display='block';
    document.getElementById('caption').innerHTML=mpic[t].Title;
    document.images.screenshot.src=minArr[t].src;
    document.images.screenshot.title='Click here! ' mpic[t].nam '. More...';
    }

    function 
    dest() {
    for (
    x=0x<mpic.lengthx++) {
    if (
    document.images.screenshot.src==minArr[x].src) {
    window.open(mpic[x].web'offsite');
    }
    }
    }

    function 
    hide() {
    document.getElementById('preview').style.display='none';
    unmarkAll();
    }

    function 
    unmarkAll() {
    for (
    c=0c<mpic.lengthc++) document.getElementById(mpic[c].markID).style.visibility='hidden';
    }
    // End -->
    </script>
    </head>

    <body>
    <script type="text/javascript">
    <!-- Begin
    codeIt()
    // End -->
    </script>

    My products1 link
    My products2 link
    </body>

    </html> 

  2. #2
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    Why is the line below the 'please attribute' empty (I know it contains, HTML, but no text)?

  3. #3
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    you can remove: /* --- Please attribute! The following line must appear --- */

Bookmarks

Posting Permissions

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