Java and java script communication

how to access a javasript string variable in java

If you are trying to access it from an applet you can do the following:
// call the html page
JSObject win = JSObject.getWindow(this);
JSObject doc = (JSObject) win.getMember("document");
JSObject loc = (JSObject) doc.getMember("location");     
String s = (String) loc.getMember("href");
String stringArg = "status from init()";     
win.setMember("status",stringArg);     
Here win is the JSObject that gets the html page
stringArg is the object value that will be placed into the javascript var.
win.setMember sets the javascript var 'status' with the value placed in stringArg.
You will need to import
import netscape.javascript.*;
also
Mark

Similar Messages

  • Javascript/vbscript functionality (java script functions are not running) issue in Internet Explorer 10 and 11

    We have developed web portal using classic ASP and java/vb script.  We used to run it absolutely fine using Internet Explorer 8.  Now we just migrated to Internet Explorer 11.  But after that no java script functionality is working in our
    web portal.
    Our web server is configured on windows 2003 server and IIS version 6.0 and has .net Framework (Microsoft.NET\Framework\v2.0.50727).  
    Could you please suggest us that is there any workaround to this? 

    Hi,
    Have you tested this web portal in compatibility mode, Tools\Compatibility view settings? or click F12 to use the developer tool, change the the document mode and user agent string to 8, check the result.
    And under Tools\Internet Options\Security\Custom level, scroll down to "Scripting", enable "Active Scripting".
    Since you're developer of the web portal, it's recommended to post issue in IE development forum
    https://social.msdn.microsoft.com/Forums/ie/en-US/home?category=iedevelopment
    Regards
    Yolanda Zhu
    TechNet Community Support

  • I'm note a firefox geek, but ever since my friend told me to install NoScript I can not access my msn and hotmail page. It tells me that Java Script is required, what ever that is. What do I do next. Do I uninstall the No Script. Thanks Ed

    I'm note a firefox geek, but ever since my friend told me to install NoScript I can not access my msn and hotmail page. It tells me that Java Script is required, what ever that is. What do I do next. Do I uninstall the No Script. Thanks Ed edit
    Details

    You are on Windows 2000, you do not have a "Firefox" button, and should consider yourself to be fortunate in that you still have menus and don't have to do anything to get the menus back instead of the "Firefox" button. (The same applies to Windows XP users).
    Use the "File" menu to get to Import. You are not on Windows 7 or Vista, and don't have to put up with the nonsense added for Aero.
    If you want the "Firefox" button you can get it with View -> toolbars -> (uncheck) Menu Bar. The menu bar and the "Firefox" button were supposed to be mutually exclusive (which is impossible in some cases without being incompatible).
    Once you are using the "Firefox" button ...
    Use the "Alt" key to view the menu bar (temporarily) containing File, Edit, View, History, Bookmarks, Tools, and Help. On Windows 7 and Vista, the menu bar was hidden by default in Firefox 4 and above. These menu items are more or less available under the "Firefox" button which has the most used of the built-in Firefox menu items available in a different format.
    To get back to having menus again. "Firefox" button -> Options (second column) -> (check) Menu Bar
    You can make '''Firefox 7.0.1''' look like Firefox 3.6.*, see numbered '''items 1-10''' in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 thru 8.0, look like 3.6)]. ''Whether or not you make changes, you should be aware of what has changed and what you have to do to use changed or missing features.''
    * http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface

  • I just downloaded and instaled firefox 4. Now, everytime I institute a command I get a po[p-up from Java script that tells me to uninstal set. I cannot go on untin I press ok and then I am good for one more command and it starts with the pop-up again.

    I'm not even sure if this is an extension or plug-in and all I can tell you is what I have already stated. I can only make one command at a time and after each one I get a pop-up from Java script that says uninstal set. I must depress ok to move on, but only for one more command and it starts over again. This also happened when I tried to instal firefox 4 a couple months ago and I deleted the program and went back to an earlier version.

    Mail troubleshooting - Yosemite
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages
    SMTP servers keep going offline

  • Data transfer B/W parent windonw and child window with out java script

    hi ,
    i am using h:outputLink Tag to open child window , i am unable to pass parent window text box value to child window with out java script , Here i am using two different backing beans for parent and child windows . Plz help me .

    Hi -- I pass details between pages regularly. The following has worked for me:
    ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    ValueBinding binding = factory.getApplication().createValueBinding("#{beanName}");
    BeanName beanProperty = (BeanName) binding.getValue(FacesContext.getCurrentInstance());
    ... then set the you can set the values. Can't recall if I need to use SaveStates for the items. Probably if you use request scope beans.

  • Hp photosmart premium wireless C309 can't print after updating to IE 9 and i think java script

     hp photosmart premium wireless C309  can't print after  updating to  IE 9 and i think java script.  I am a realtor working from home and inorder to use the forms it required I update to IE9 and I think java,   this is the link.   http://www.car.org/tools/zipform6/   After doing so my printer does not work.  I tried to go on line and reinstall from a link on line but it did not work.  I don't know what to delete and what to add and how to get the " HP sSolution center" to work again.  the printer was already poor performance from day one.  Always having to unplug and restart and the black ink always runs out too quick.  but right now my concern is just being able to print and scan.  I am in the middle of a deal and can not communicate  with all parties effectively.  please help

    What error messages are you getting?
    What OS are you using?
    How is the printer connected to the computer?
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • I need to write a Java script to make my Art board bigger by 1 (one) inch on the Width and Length, Regardless of the Content?

    Hi,
    I am currently using "Visible bounds" (java script)to add 1 inch to the width and to the Length of my Art board, but when i make a clipping mask it actually reads the hidden content from the Clipping mask and makes conforms my art board to that particular shape. Am using Adobe illustrator cs6 Here is My Code:
    var myDocs = app.documents;
    var i = 0;
    for (i = myDocs.length-1 ; i >= 0; i--)
        var doc = myDocs[i];
        app.activeDocument= doc;
        var myVisibleBounds = doc.visibleBounds; //Rect, which is an array;
        myVisibleBounds[0] -= 36;
        myVisibleBounds[1] += 36;
        myVisibleBounds[2] += 36;
        myVisibleBounds[3] -= 36;
        doc.artboards[0].artboardRect = myVisibleBounds;
    All i Want is to add 1 inch to my width and length and this does it but if i have a clipping mask it will pick up the bounding box i guess? and it will conform it to the shape... any help please... Try my code and you will see that it does add 1 inch but now make you artboard lest say 12" x 12" and make a shape bigger than the art board and you will see how it adds 1 inch to the art board based on that shape...  now if you make a clipping mask to fit that shape in the 12" x 12" art board you will still get 1 inch bigger than the shape thats being clipped ... 

    yes, visible bounds is reading the non-visible masked objects too.
    you're going to have to do it the hard way, loop through all your objects to get your bounds manually, and while you're at it, test for clipping masks and use the masking path instead.

  • Ever since I downloaded FF's v6, everytime I go to YouTube and open a video, I get an error message that says: "[Java Script Application] Error: Div is null" How do I fix this problem?

    If I go to YouTube, no matter what video I click on to watch, the error message "[Java Script Application] Error: Div is null" pops up. It started happening right after I updated to FF v6. I also have installed the latest version of Java. I submitted this question a few weeks ago, but never received a reply.
    Thanks for any help you can provide to fix this.
    Scott Cromwell
    [email protected]

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • I upgraded to Firefox 8.0 and java script no longer works. I set the options to allow java script in the tools/options to allow java script but it still doesn't work. Are there any fixes?

    I support several web sites that I developed for clients and I use java script to manage/show slide shows. After upgrading to 8.0 my scripts don't load. When I click on preview on my web development tool my page will not load the java script - nothing shows on te screen. All used to work OK and still works in IE.

    Thanks for the response, Karsten,
    However, no Divx 5 Component but I did have a Divx Decoder Component and a Divx 6 Decoder Component, so I tried what you suggested anyway with those but to no avail.
    Still not working!
    Regards,
    John

  • HT4623 I did the latest update to my i pad 2 and now Safari does not work properly . I get messages that the java script needs to be turned on which I did. How do I get this all back after this update?

    I did the latest update to my I pad 2 and lost Safari . I was instructed to switch the Java script on which I did but Safari is still not working properly . how do I get everything back after this software update.

    Try a reset: hold down the home button along with the power button until you see the Apple, then let go.

  • I downloaded Firefox Optimized for Yahoo on my PC and get an error message about every 15 seconds: Java Script/ Uninstall set. I deleted Firefox and did a new download/installation and am getting the same problem.

    :I went to Mozilla's website and downloaded the Firefox Optimized for Yahoo, following the directions. The download installed easily, but when it opened my Yahoo web page (I already had an account with them), the Java Script error message "Uninstall set!" immediately began alerts, and kept repeating the alert about every 15 seconds. I got the same result even after uninstalling Firefox and downloading a fresh installation. I am only getting this alert via Firefox; I do not get it when using my Yahoo page with Google. Thanks.

    See:
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • I can not get Firefox to play music backgrounds on pages in browsers it works in IE and other browsers but not firefox, what HTML or Jave script do I need too use to make them work?

    I'm having a problem with firefox playing background music on some sites, it works with IE and other browsers but not with fire fox, what html or java script do I need to add to the pages so that they play the music?
    I develop my pages in Front Page and I know that the music only works in IE, so if someone can tell me how to correct this problem as it is important as I use fire fox as my main browser.
    I thank you in advance

    If a website uses BGSOUND then it will only work in IE.
    BGSOUND is not compatible with other browsers like Firefox.
    * http://kb.mozillazine.org/Background_music_does_not_play

  • Need flash player 8 and java script enabled to play videos on ipad, need help please.

    need flash player 8 and java script enabled on my ipad in order to view videos.  please help.

    iPads do not directly support Flash.
    You can look for Flash Browsers in the App store for some options to try. Support is not 100%, but maybe one may work for you.  Browsers like Puffin, Skyfire, Photon etc...
    IPads do fully support JavaScript.  Just make sure its turned on under Settings->Safari->Advanced->JavaScript.
    If you require Java, which is completely different to JavaScript, again there are some browsers in the App store that support it.  Search for "Java browsers" in the store.

  • Creating order form and need Java Script to calculate unit price and quantity in Acrobat Pro.

    Hi,
    I am creating order form in Acrobat Pro , and I have
    code
    Order Quantity
    Unit price $
    201
    500
    $ 0.52
    201
    1000
    $ 0.36
    202
    300
    $ 0.26
    202
    500
    $ 0.2
    How make Subtotal and Total price with Java script.
    I do not know how to write java script.
    Anyone can help me?
    Thanks,

    Thanks for your response. I have 2 quantities and 2 Unit price for each code, I know a simple sum in calculation it works for 1 unit price and quantity.  Can you please let me know how to do it? One of the expert sent m this:
    //change field names as needed
    var qt1 = this.getField("qt1").value;
    var up1 = this.getField("up1").value;
    var qt2 = this.getField("qt2").value;
    var up2 = this.getField("up2").value;
    event.value = (qt1 * up1) + (qt2 * up2);
    I put this in total text field (calculation tab , Custom script) , but it  did not worked.
    I appreciate it if anyone can help or give me  suggestion.

  • Why do i keep getting Java Script Application saying uninstal and every time i click on my mouse the pop up appears and its sometimes hard to get rid of it. Please help. God Bless

    As soon as I log on to Firefox this pop up appears on the screen saying Java Script Application and under neath it it says uninstal and beside uninstal is a yellow triangle with a exclamation mark inside of it. Every time I click the mouse the pop up reappears over and over. It's really a nuisance and I need your help.The word uninstal is spelled like you see it, even though it's spelled wrong.Thank you and God Bless

    Other users have reported that this is caused by one of their add-ons. I suggest going to the Add-ons page and disabling everything that is not essential, and then restarting Firefox. Hopefully it's not caused by something you really rely on.
    orange Firefox button ''or'' Tools menu > Add-ons
    On the left side, click Extensions
    Then disable as many as possible and restart Firefox.
    Any luck?

Maybe you are looking for