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 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What's wrong with this function?

    Hi

    I am having difficulty with the displaylogo() function. I have given the logo "name=slide" and had hoped that the displaylogo() would be able to display the content of image1.src. What am I doing wrong? Please help.

    <script language="javascript">

    <!-- Preload logo
    var image1=new Image()
    image1.src="images/titlelogo.gif"



    function displaylogo() {
    setCell('textcell',MO_text['empty']);

    document.images.slide.src=eval("image1.src") ;

    }

    //-->
    </script>


    <body>

    <img src="images/titlelogo.GIF" name="slide" width="220" height="54"




    bye
    Allyson

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think this is the mistake -- its not really a mistake just a mis type or somthin.


    document.images.slide.src=eval("image1.src") ;

    should be


    document.images.slide.src=eval(image1.src) ;


    Not garentying that this will work , But give it a try
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    i'm pretty sure that you don't need to use eval() at all. try this:

    document.images.slide.src=image1.src;
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    Thank-you for your suggestions. Unfortunately they do not work. The code is at http://homepages.ihug.co.nz/~usatede...a/entryyay.htm

    What should happen, is the logo should appear when the mouse is not on the palette. I thought that the document.images.slide.src=image1.src; would work. I'm not sure what's wrong.

    bye
    Allyson

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Remove MO_text['empty']='' and put:

    MO_text['logo']='<img src="http://homepages.ihug.co.nz/~usateden/panacea/images/titlelogo.GIF" name="slide" width="220" height="54">';


    Then for your display logo() function:


    function displaylogo() {
    setCell('textcell',MO_text['logo']);
    }

  • #6
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Thank-you

    Hi

    Thank you very much. It works.


  •  

    Posting Permissions

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