?
Solved

Javascript calling applet function

Posted on 2002-03-13
4
Medium Priority
?
187 Views
Last Modified: 2012-05-04
Here is my HTML code:

<html>
     <head>
     </head>
<script language="javascript">
     function openVideo(){
     document.myapplet.displayURL("http://www.google.com");
     }
</script>
<body>
<a href="" onClick="openVideo();"> open video </a> <br>

<script language="javascript">
document.write("<APPLET CODE=\"com.package.MyApplet\" NAME=\"myapplet\" WIDTH = \""+width+"\" HEIGHT =
\""+height+"\" ARCHIVE = \"code.jar\" MAYSCRIPT>");
document.write("</APPLET>");
</script>

</body>

My Applet has a public function:
public void displayURL(String url);
However when I run this page, I get an error:"Object doesn't support this property or method". The line cause this error is:
document.myapplet.displayURL("http://www.google.com");
I'm using IE 6.0.2600.
I tried <Object ID=...> but the same thing happens.
0
Comment
Question by:daitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Author Comment

by:daitt
ID: 6863601
I removed some variables for you to easier to read, so you might wonder what is width and height.
width=640;
height=480;
0
 
LVL 30

Accepted Solution

by:
third earned 150 total points
ID: 6863614
0
 
LVL 3

Author Comment

by:daitt
ID: 6863918
I checked again and found out that after my applet is processed by DashO, the function is renamed. I uncheck the renaming for that function and now the javascript can call that function.
I accept third's comment because after I got the applet from the site and after stripping all the redundant code, I have a version that works. It proves that my code is ok and the problem must be somewhere else.
0
 
LVL 30

Expert Comment

by:third
ID: 6863938
actually, i haven't got a clue on your problem and accidentally i found this page. it came to my mind that the problem might come on tha java code itself but i wasn't sure so i just directed you to the link for you to find out. ;-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question