[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Javascript calling applet function

Posted on 2002-03-13
4
Medium Priority
?
189 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

656 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