How to Call Java Function Within HTML

  • Thread starter Larry R Harrison Jr
  • Start date
L

Larry R Harrison Jr

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
 
M

Mark Parnell


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

Try news://comp.lang.javascript
 
D

DaveG

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
 
S

SpaceGirl

Larry said:
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 #
 
L

Larry R Harrison Jr

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top