Does anyone know how you can test if an applet's method exists before you try and call it?
for example, if you don't have a JRE installed on your computer and try and access an applet method it shoots out a javascript error at you. I want to be able to test if the applet is operational basically before I try and use any of its methods.
I have on a html page an applet. A javascript function call one function of this applet. It works with IE but not with Mozilla or Netscape. I obtain the following error on the java-plugin consol:
sun.plugin.liveconnect.OriginNotAllowedException: Javascript is not form the same origin as je java code ...
This is my html code:
<script language="Javascript"> <!-- function askServerCmd() { return document.AppReaderLink.askServerCmd();
How do I display a message applet is loading when a applet is getting loaded. Without using Mediatracker.I want the message to be provided as PARAM NAME.
We have an applet that has to support the SUN VMs as well as the MS VM. The applet receives updates from a server (via tcp or http) and wraps them up as objects and passes them using the JSObject scripting context to a javascript function.
This function takes the object and reads the properties and updates a screen.
All seems simple stuff. The problem is that the MS JVM runs like a rocket, but the sun vm seems to max out our processor and also takes ages to process anything.
I have tried logging from the console using debug level 5, and it shows a lot of back and forth between the applet and the javascript when accessing methods on the object passed.
Seeing that as a possible problem, I now pass a delimited string to the front end, and then convert that into an update message purely in javascript so there is only one hit to the applet per message.
I am still seeing a massive difference between the sun and ms VMs.
Has anyone ever come across this, and is there anything I can do to help flatten out this performance?
I'm doing an intranet with a media part. So im must be able to upload files on a ftp server AND have a record of informations about this file and meta date in a MySQL database, shown in a php page.
So the first thing i was doing was:
1/ * A HTML Form, with a <input type="file"> which was uploading the file to the web server. And then, in the next action-php-page, using ftp functions from php to upload to the ftp server. But this make upload the file 2 times, which slow, and the user can't do anythig except waiting in front of a blanck loading page.
=> no way
(BTW, the site admin refuse that the ftp server and the web server to be the same computer)
So i tried something else:
2/ * A HTML form, the user enter meta data about the media, click next, and then, a php page which loads a java applet an pass informations to it (by param tags). The applet have a browse button, and a go button, which start the transfert (JDK 1.4.1) trough the URLConnection. The file is uploaded once, and there is a progress bar, which is wonderful.
But now, i need the src_file information wich is the java applet. So i have two options:
A/ I make a post to the webserver from the applet. But i'm using session identification (needed for tracing users actions) and i'm gonna use SSL in less than one month, so i think it would be complicated.
B/ I export the information from the java applet to javascript, and then to HTML hidden field, so that the user can submit the full-hidden-filled form. But i can't make LiveConnect works.
i'm under Mac OS X 10.2 (jaguar) so i need to make work LiveConnect on both Safari 1.0 (v85.6), mozilla 1.5, and Mac OS IE (5.2).
I call methods in a Java applet with javascript code like this:
document.myApplet.methodName(); This works great when the applet has loaded (the JVM has started and dowloaded all the jars) but it fails if the applet hasn't loaded yet, at which point it gives an error: Quote:
Error: Object doesn't support this property or method
Is there a way to determine that the applet is loaded or not so that I can use it in an if statement? For instance, like so: Code: if (isAppletLoaded()) { document.myApplet.methodName(); } I tried Code: document.myApplet == null but that didn't work.
I was putting some javascript in a form and doing my usual testing and swearing when the javascript did not run without an error message of any type and reverting the code back until it did run and adding code til it didn't.
Then it hit me - isn't there a better way - doesn't someone have a program or utility that will help debug Javascript ???
As I'm doing Javascript it is much harder to decode than the 30 year-old Fortran programs - they typically gave a line number and variable name that was missing.
When I did Basic before Visual Basic, the editor identified errors in real time as we typed. What is available for Javascript?
The javascript fails to call an embeded applet's function. In the javascript console, it shows "Error XXXX is not a function". Following are some parts of my code.
Here parent.document.cpmApplet and parent.BottomIframe.document.resultApplet are valid since I loaded both the applets with the same name using <APPLET> tag for Netscape/Mozilla and OBJECT tag for Windows.
The issue is with Netscape and Mozilla on Unix platforms only. I would appreciate if anyone could help me to solve this.
I am looking at a client’s site that has a scrolling text bar at the bottom of the page for latest news. I have been asked to recommend whether they keep the scrolling text as a java applet or whether they make it dhtml with Javascript to make it scroll.
To be honest, I’m not sure whether there really is an important difference, in terms of download time, likelihood of working (if client browsers are better enabled for one verses the other), or whether there are any other reasons one should be used over the other.
First let me describe the problem. I have an HTML form that in one field has an onBlur call to a JavaScript function. When you exit the field, it calls the JavaScript routine, which in turn calls a PHP script. The PHP script runs returns the value needed. And returns to the JavaScript. The JavaScript function is then supposed to set alerts depending on the values returned from the PHP script. It doesn't. If you then move the cursor into the field and exit again, it again runs the JavaScript which calls the PHP script then proceeds to show the alerts exactly like it is supposed to.
I did some experimenting, and if you use a button to run the JavaScript, the exact same thing happens. Click the button and the PHP script sends back the value, but no alert. You click the button a second time, and the alert shows.
I am using the JavaScript monitor in FireFox v1.5 so I can see that the PHP script is being called and returning the correct value the first time. So what I am trying to figure out is why the routine has to be called twice before I get my alert.
Below is the HTML, JavaScript & PHP that I am using....
I ve a aspx page with a textbox.I have created the Text_Changed event for this textbox.We know that , this will be fired when we enter any text in that textbox and pressing the enter key.quite natural.
I am putting some text in that text box thru javascript from the window_onfocus event.
After that , i need that the text_changed(server event) event to be fired,so that i could perform some search operation.
Could you please tell me how can i call the Text_changed server event from the javascript.
I am trying to call a java method from within my Javascript, but cannot seem to get it to work. All the examples I have found online and in the forums are using Java applets. I have a method that I want to call that does a search, and produces a message dialog displaying the results. Also, the class file lives next to the html file. How would I invoke this in my code? This is what I have now:
I have my events and syntax in the immediate script and they were working fine. But Im trying to move it all into the Script tags and call on them by using the function ID but cant seem to figure it out. here's what I got:
<html> <body> <script type="text/javascript"> function txtAmenity()
I have a script that is working well to detect if the client has acrobat reader is installed or not. I can print out next to the PDF link if the user has or hasn't got the reader. My problem is that i want to call that function and print something out only if the user clicks on the link to see the PDF file. This is where i'm at at the mo
do you know if it's possible to call a python script in html page?? I want call my script pyhton and I have a html with javascript but I don't know how, do you have an example??
Hi, I have this JavaScript, which I only want to occur if a user clicks on a hyperlink hotspot in a large image:
<script type="text/javascript"> <!-- var answer = confirm ("This link is not available, click OK to load a similar link, or Cancel to not.") if (!answer) window.location="http://www.yahoo.com/" // --> </script>
To make matters more challenging, there are about 10 hotspots in the image, and I want them each to have a different value for window.location. I.e. if the user clicks OK in each hotspot, each one will redirect them to a different site.
I have some javascript that works in Firefox 2 but not in IE 7. In the parent page, a user clicks a link and a new window is opened so that they can maintain some values. When the user is finished, they can click either a save or a cancel button. If the user clicks the save button, I want the parent page to be refreshed and then the child window to close. I have this working perfectly in FF2 but it does not in IE. In IE, the parent page is refreshed but when it refreshes, the screen that comes back is the same screen as the child window. When the child window should close, it instead is being refreshed and comes back as a blank screen. Code:
I've been using JavaScript for a few years now I'm not a huge expert I rely more of JQuery. I am just wondering what best solutions are there to call Javascript files (and to make pages load faster):
Normally I request all these in the Header like you normally would but I have seen and heard people to call their Javascript files in the footer to make page load faster and have all their Javascript functions all in the footer as well.
Is this a good idea? What are the downside? Should I just keep all my JS in the Header as usual?
I have seen this employed somewhere else, but for the life of me cannot remember how it was done. I need to write a javascript that will call a desired CSS file based on the user's browser.
We have an app that uses a page to either load a full page applet, or some html based on some params.
There are events trapped for rigth click actions that show a DIV with some menu options. Works fine with the HTML...
But, of course, by default the Applet seems to take precedence over any DIV etc on top.
I already feed the events back from the applet back through to the HTML via javascript, what I need to do is display the div over the applet so that thet user knows no different...