How to Call Java Function Within HTML

Discussion in 'HTML' started by Larry R Harrison Jr, Aug 11, 2004.

  1. I have a webpage for showing slideshows. I got the code from

    http://javascript.internet.com/miscellaneous/image-slideshow.html

    It's very simple, clean-looking, and small-sized.

    The only problem--it doesn't start the slideshow when you load it--and it
    tends to skip to slide #2. (I thus insert a "blank slide"--basically
    "nothing.jpg"--to make up for this.) The person has to click "start" once
    the page loads. I'd rather it start automatically.

    Seems easy enough--the function that the start button calls--and it calls it
    within HTML (not Java)--is a Java function called ap(text). The button calls
    it by saying "ap(this.value); I figure I would start it with something like
    ap.("name_of_1st_slide"). Problem is, I don't know what code will call it
    flat-out once the code loads--without the user having to click any buttons.
    That is what I need--the whatever that would go in front of ap.("nameof1st
    slide") to flat-out execute it upon loading of the webpage.

    Tips?

    LRH
    Larry R Harrison Jr, Aug 11, 2004
    #1
    1. Advertising

  2. Larry R Harrison Jr

    Mark Parnell Guest

    On Tue, 10 Aug 2004 22:59:50 -0700, Larry R Harrison Jr
    <> declared in alt.html:

    > http://javascript.internet.com/miscellaneous/image-slideshow.html


    Have you tried asking the page author?

    > Seems easy enough--the function that the start button calls--and it calls it
    > within HTML (not Java)


    You're right - Java has nothing to do with it.

    > --is a Java function called ap(text).


    No, it's a javascript function. Java != javascript.
    http://www.google.com.au/search?q=difference between java javascript

    > Tips?


    Try news://comp.lang.javascript

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    "Never drink rum&coke whilst reading usenet" - rf 2004
    Mark Parnell, Aug 11, 2004
    #2
    1. Advertising

  3. Larry R Harrison Jr

    DaveG Guest

    On Tue, 10 Aug 2004 22:59:50 -0700, Larry R Harrison Jr wrote:

    > I have a webpage for showing slideshows. I got the code from
    >
    > http://javascript.internet.com/miscellaneous/image-slideshow.html
    >
    > It's very simple, clean-looking, and small-sized.
    >
    > The only problem--it doesn't start the slideshow when you load it--and it
    > tends to skip to slide #2. (I thus insert a "blank slide"--basically
    > "nothing.jpg"--to make up for this.) The person has to click "start" once
    > the page loads. I'd rather it start automatically.
    >
    > Seems easy enough--the function that the start button calls--and it calls it
    > within HTML (not Java)--is a Java function called ap(text). The button calls
    > it by saying "ap(this.value); I figure I would start it with something like
    > ap.("name_of_1st_slide"). Problem is, I don't know what code will call it
    > flat-out once the code loads--without the user having to click any buttons.
    > That is what I need--the whatever that would go in front of ap.("nameof1st
    > slide") to flat-out execute it upon loading of the webpage.
    >
    > Tips?
    >
    > LRH



    Hi

    I would try adding an onload event handler to the body tag

    <body onload="first()">

    This will run the first() function in the javaScript after the rest of the
    web page has loaded.
    From the website it looks like first() is tyhe first function to run.

    Good Luck
    DaveG
    DaveG, Aug 11, 2004
    #3
  4. Larry R Harrison Jr

    SpaceGirl Guest

    Larry R Harrison Jr wrote:

    > I have a webpage for showing slideshows. I got the code from
    >
    > http://javascript.internet.com/miscellaneous/image-slideshow.html
    >
    > It's very simple, clean-looking, and small-sized.
    >
    > The only problem--it doesn't start the slideshow when you load it--and it
    > tends to skip to slide #2. (I thus insert a "blank slide"--basically
    > "nothing.jpg"--to make up for this.) The person has to click "start" once
    > the page loads. I'd rather it start automatically.
    >
    > Seems easy enough--the function that the start button calls--and it calls it
    > within HTML (not Java)--is a Java function called ap(text). The button calls
    > it by saying "ap(this.value); I figure I would start it with something like
    > ap.("name_of_1st_slide"). Problem is, I don't know what code will call it
    > flat-out once the code loads--without the user having to click any buttons.
    > That is what I need--the whatever that would go in front of ap.("nameof1st
    > slide") to flat-out execute it upon loading of the webpage.
    >
    > Tips?
    >
    > LRH
    >
    >
    >


    Write this down on a bit of paper and stick it on the side of your screen:

    "Java is not JavaScript."

    <body onload="myjsfunctioncall();">


    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    SpaceGirl, Aug 11, 2004
    #4
  5. Okay okay okay. I got it--Java <> JavaSCRIPT.

    Thanks for the code just the same.

    I did post in comp.lang.javascript, no reply so far.

    "SpaceGirl" <> wrote in message
    news:...
    > Larry R Harrison Jr wrote:
    >
    > > I have a webpage for showing slideshows. I got the code from
    > >
    > > http://javascript.internet.com/miscellaneous/image-slideshow.html
    > >
    > > It's very simple, clean-looking, and small-sized.
    > >
    > > The only problem--it doesn't start the slideshow when you load it--and

    it
    > > tends to skip to slide #2. (I thus insert a "blank slide"--basically
    > > "nothing.jpg"--to make up for this.) The person has to click "start"

    once
    > > the page loads. I'd rather it start automatically.
    > >
    > > Seems easy enough--the function that the start button calls--and it

    calls it
    > > within HTML (not Java)--is a Java function called ap(text). The button

    calls
    > > it by saying "ap(this.value); I figure I would start it with something

    like
    > > ap.("name_of_1st_slide"). Problem is, I don't know what code will call

    it
    > > flat-out once the code loads--without the user having to click any

    buttons.
    > > That is what I need--the whatever that would go in front of

    ap.("nameof1st
    > > slide") to flat-out execute it upon loading of the webpage.
    > >
    > > Tips?
    > >
    > > LRH
    > >
    > >
    > >

    >
    > Write this down on a bit of paper and stick it on the side of your screen:
    >
    > "Java is not JavaScript."
    >
    > <body onload="myjsfunctioncall();">
    >
    >
    > --
    >
    >
    > x theSpaceGirl (miranda)
    >
    > # lead designer @ http://www.dhnewmedia.com #
    > # remove NO SPAM to email, or use form on website #
    Larry R Harrison Jr, Aug 11, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. grbgooglefan
    Replies:
    2
    Views:
    409
    Pascal Bourguignon
    Jan 30, 2008
  2. grbgooglefan
    Replies:
    4
    Views:
    428
    Kenny McCormack
    Jan 30, 2008
  3. grbgooglefan
    Replies:
    0
    Views:
    382
    grbgooglefan
    Jan 30, 2008
  4. Alok
    Replies:
    3
    Views:
    238
  5. Andrew Poulos
    Replies:
    1
    Views:
    89
    Andrew Poulos
    Oct 11, 2006
Loading...

Share This Page