Error in calling a javascript function

Hi
Below is a code from my HTML file...
<html>
<head>
<script language="javascript" >
function try()
alert("hi");
</script>
</head>
<body>
<input type="button" value="Hello world!"
onclick='try();'>
</body>
</html>while running page in browser i m getting error :
line: 12
char: 4
error: expected "{"
I understand that this is not a java problem but please help.
thanx
Edited by: money321 on Feb 5, 2008 6:07 AM

I know that this is not the right forum, but I'd like peoples' advice on which prep to use for a colonoscopy. The Fleet's Phosphosoda prep is more palatable, and easier and more convenient to take compared to the Colyte (gallon jug) prep, but on the other hand the Colyte prep is safer since it doesn't carry the risk of calcium phosphate precipitates forming in the kidneys potentially causing acute kidney failure, a rare but certainly serious complication. Many thanks in advance.

Similar Messages

  • Error when calling a Javascript function loaded as a library

    Hi All,
    I have some javascript functions in a custom js file which is in OA_HTML dir. I have loaded this js library using pageContext.putjavascriptlibrary("ABC","custom.js") in processRequest. When I deploy my code, there is a javascript error in the page. It does not seem to find the javascript function.
    My code in PR is :
    pageContext.putjavascriptlibrary("ABC","custom.js")
    someBean.setOnFocus("javascript: callFunc(this);"); //callFunc(obj) is defined in custom.js
    It works locally when I have my custom.js in myhtml directory. I am getting an error when I deploy the code on to the instance's apps server. Is there something that I am missing?
    Thanks in advance
    Raja

    Raja,
    You can bounce apache , and server cache would be refreshed!I guess then ur updated js function should work. Also,check ur js function works correctly on jdev.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                               

  • How do you call a JavaScript function from a Java applet

    I have an Applet that needs to run on the following platforms: Internet Explorer (Windows-NT, Windows -2000), Netscape (Windows-NT, Windows-2000, Sun(Solaris), RedHat(Linux), HP(11.0), IBM(AIX)).
    The Applet needs to call a JavaScript function that is included on the HTML page that contains the applet. In JRE-1.3.1 I used the AppletContext.showDocument(url,"_self" ) where the url is "javascript:MyScript('param1')". This works just fine. I tried using showDocument without the second parameter and all the other choices for the second parameter and none of them worked (nothing happened).
    I tried the same code with JRE version 1.4-beta. It seems that version 1.4-beta no longer supports a URL that starts with "javascript" in the AppletContext.showDocument(url,"_self" ) method. The error is:
    netscape.javascript.JSException: call does not support self.open
    at sun.plugin.javascript.navig.Window.call(Unknown Source)
    at sun.plugin.ActivatorAppletContext.showDocument(Unknown Source)
    I tried to catch the JSException but I cannot seem to.
    I then tried a completely different approach. I then grabbed the JSObject for the page and tried to call my javascript function (MyScript) directly:
    JSObject theObj = JSObject.getWindow(this);
    Object paramArray[] = new Object[1];
    paramArray[0] = Param1;
    theObj.call("MyScript", paramArray);
    This worked fine on Netscape[Windows-NT, Windows-2000]. HP throws a JSException on getWindow() and Solaris just hangs. I did not even try IE.
    What is the recommended approach here?

    you can try this, it worked for me:
    JSObject win = JSObject.getWindow(this);
    win.eval(function_call);
    I have other ways also, so if this doesn't work, let me know.

  • How can I have a backing file call a JavaScript function?

    I have a Weblogic portal with a JSP portlet. The portlet has a backing file. How can I get the backing file to call a JavaScript function in my portlet?
    thanks

    Hi
    your questions are not correct because you are mixing up server side operations with client side operations.
    First server side code executes then the page is sent to the browser , then any javascript executes on the browser. So asking for javascript to be called from backing file (server side) doesn't make sense or asking for javascript to read a parameter doesnt exactly work either.
    However in your server code suppose you have a variable action in the request that you want javascript to know then in your JSP you would add something like
    <script type="text/javascript">
    var action = '${requestScope.action}';
    alert(action);//or whatever you want to do
    <c:if test="${requestScope.someOthervariable == ''xyz'}"><%-- this check is done on the server --%>
    callSomeJavascript(); <%--this javascript is only executed when the server side value of someOtherVariable is xyz --%>
    </c:if>
    </script>
    i.e. you can output the javascript that has the variables you need or the function calls you want.
    Like I said understand whats server side and whats client side.

  • How to call a Javascript function from backing bean without any event

    Hi,
    Someone knows how to call a Javascript function from backing bean without any event ?
    thanks

    Please review the following thread:
    ADF Faces call javascript
    Luis.

  • Help needed in calling a javascript function from a jsp

    Hey guys,
    I need help.
    In my jsp I have a field called date. When i get date field from the database, it is a concatination of date and time field, so I wrote a small javascript function to strip just the date part from this date and time value.
    The javascript function is
    function formatDate(fieldName)
              var timer=fieldName;
              timer = timer.substring(5,7)+"/"+timer.substring(8,10)+"/"+timer.substring(0,4);
              return timer;
    Now I want to call this javascript function from the input tag in jsp where I am displaying the value of date. Check below
    This is one way I tried to do:
    <input size="13" name="startDate" maxLength="255" value=<script>formatDate("<%=startDate%>")</script> onChange="checkDate(this)">
    I even tried this:
    <input size="13" name="startDate" maxLength="255" value="'formatDate(<%=startDate%>)'" onChange="checkDate(this)">
    But it dosen't work
    Please help. I am struggling on this for days.
    Thanks,
    Ruby

    Hey all you developers out there , Pleaseeee help me with this one.

  • Formal error: Invalid calling sequence for function modules

    Hi All,
    I have developed a function module for FQEVENT 620 Payment: Transfer Line Items for Clearing.
    The clearing works fine.
    After clearing the open items i need to post an FI-CA Document(BAPI : BAPI_CTRACDOCUMENT_CREATE) for each open item(cleared item)
    I have used the bapi : BAPI_CTRACDOCUMENT_CREATE in the same function module that i have developed for FQEVENT 620 Payment: Transfer Line Items for Clearing.Here i am getting an error "Formal error: Invalid calling sequence for function modules".
    So please let me know where i can use this bapi to post fi-ca document.Is there a BAdi or Enhancement Spot where i can use this BAPI or tell me what should i do to overcome this error.
    Regards
    Venkat

    Venkat:
    While I am confused about your business process - creating an open item when clearing one seems strange.  Look into event 0020 which is called after documents are posted - it may present the opportunity to post process additional documents.
    regards,
    bill.

  • Error when calling SOAP Runtime functions

    Hi Guys,
    I have a requirement in which i have to consume a webservice and get a response from it but when i consumed the web service and tried to test it i got the below error please let me know solution for this as it is very urgent and also i am very new to web services stuff
    Error when calling SOAP Runtime functions: SRT: Processing error in Internet Communication Framework: ("ICF Error when receiving the response: ICM_HTTP_CONNECTION_FAILED")
    Thanks
    shivraj

    Hi,
    Have a look at this blog from Michal Krawczyk to find a solution:
    The specified item was not found.
    Hope this helps,
    Grzegorz

  • Calling a JavaScript function from an JApplet...

    Can anyone help? Is it possible to call a JavaScript function from within a JApplet? If so, what is the syntax? I've seen reference to the Netscape package but I've been led to believe it doesn't always work within Internet Explorer 6 which is the target browser.
    If the above is not possible can anyone tell me if and how it is possible to load images from outside the init() method of a JApplet? This would allow me to work around the problem.
    Thanks in advance - Jim.

    Call javascript you use the JSObject
    Please note the MAYSCRIPT int the html file.
    html file:
         <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                  height="0" width="0" >
            <param name="code" value="someApplet.class" />
            <!--[if !IE]> Mozilla/Netscape and its brethren -->
            <object classid="java:someApplet.class"
                    height="0" width="0"
                    mayscript=true>
            </object>
            <!-- <![endif]-->
          </object>
    <LABEL id="lblOutputText">This text is the HTML text </LABEL>java class:
    // new class for jsObject!!!! compile this: javac -classpath "C:\Program Files\Java\jre1.5.0\lib\plugin.jar" someApplet.java
    // since jaws.jar does not exsist anymore
    // in 1.4.0 to compile: javac -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" someApplet.java
    // for msjvm use the -source 1.3 -target 1.1 option so the command looks like this:
    // javac -source 1.3 -target 1.1 -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" someApplet.java
    import netscape.javascript.*;
    public class someApplet extends java.applet.Applet {
        JSObject win;
        public void init() {
             try{
                 win = JSObject.getWindow(this);
    // you need win.eval("window.close();"); // to close the window. if the current window is not a popup
    // opened by a parent with window.open than the user will get a waring, your next question probably will
    // be "can I stop this warning" and the answer is simple: NO
                 JSObject textBoxLabel = (JSObject) win.eval("document.getElementById('lblOutputText')");
                 textBoxLabel.setMember("innerHTML", "<center><h1>Some text</h1></center>");
            }catch(Exception e){
                 e.printStackTrace();
    }

  • Call a Javascript function without JSObject

    Hi all,
    With j2 sdk 1.4.2_08 the JSObject doesn't seem to ship anymore. I need to find a solution to either:
    1. call a javascript function from within an applet without the JSObject
    2. or find a different way of executing the http: or mailto: protocols in a new browserwindow.
    Would getAppletContext ().showDocument (new URL (oURLString),"Titlet"); be able to do this trick for me? The thing is that with this applet people can click on an image of a map, and then a new browserwindow opens up which calls an asp which shows certain database information. The mailto: protocol is used to enable users to send an email from the applet with certain informations about the map as well.
    TIA,
    Stefan

    hmmmm. That might do the trick for me as well, but I had hoped I would not have to change the page in which the applet loads ...
    I think I'll give showDocument a couple of tries, and I also think I should download the docs for this version.
    BTW, it could very well be that the JSObject was never part of the JRE/plugin. It's just that this project is a very old solution revisited (I first developed it in 1998 or 1999, then worked again on it in 2001/2003, and now it's come back to haunt me again). It's just that when I do a javac it complains about not being able to find netscape.javascript.*. For now I've commented them out, which means two of my commands don't work anymore, and before I deliver I have to fix that.
    Thanks,
    Stefan

  • Call a javascript function (in ASPX) page from a javascript file

    I have a javascript file (viewer.js) situated in Scripts/viewer.js My
    default.aspx has a javascript functions that calls a c# function in the
    default.aspx.cs ( it sends a http webrequest)
    Now I want to call from the viewer.js the function in default.aspx which calls the c# function.
    How can I handle this in my viewer.js?
    I need to do this because I work with 3D objects and the select event is on the viewer.js
    When I select the 3D object it needs to call the function in default.aspx...
    Scripts/viewer.js
    function ClickPickItem(item) {
    $("#properties").show();
    /*Call function App() */
    Default.aspx
    function App() {
    PageMethods.Connect(callback);
    Default.aspx.cs
    [WebMethod]
    public static string Connect()
    string rsp = DigestAuthFixer.GrabResponse("http://<username>:<password>@nextbus.mxdata.co.uk/nextbuses/1.0/1");
    ... CODE TO MAKE HTTPWEBREQUEST}
    Sorry if I'm not clear enough
    I don't see another option like this
    What I need to do?
    Thanks!

    If my understanding is not wrong, you are trying to call a Javascript function in a separate script block from a linked Javascript page. rite?
    When it comes to Javascript, all scripts will be posted to the client side browser and we can access any method between pages provided those JS files are linked to the page.
    So you can directly call
    App()
    function from your
    ClickPickItem()
    function.
    Please try and let us know your result.

  • Is it possible to call a JavaScript function from a dialog?

    Hi there,
    At the moment I have created a dialog, that consists of three text fields that a user fills out, and then clicks next.
    What I am attempting to do, is pass the result of these three textboxes to a JavaScript function I have laying in a file in Web Resources. I've done some research, and I can't find anything.
    So my question is - is it possible to call a JavaScript function from a dialog?
    Thanks for your time.

    Hi,
         It is not possible unfortunately. We can start dialog from script but not the other way unfortunately. However, you can always write server side code for this and it will surely execute. So instead of javascript, write plug-in.
    Hope this helps.
     Minal Dahiya
     blog : http://minaldahiya.blogspot.com.au/
     If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

  • How to call a javascript function from XSL

    I'd a requirement to take an action each time a page loads
    I called the javascript function from addLoadEvent() available in javascript.
    But my reviewer commented that it should be called using XSL as we are using XSLT,
    What is preferred?
    To pass function name to the already available function or somehow call it from xsl ? if second is preferred option then,
    how to call a function through XSLT, if it is to be called aftr the page loads?

    Thank u..
    but i'd seen that link wen i searched in google..
    Is it possible without using any 3rd party JARs and all?
    and more importantly plz tell me what should be preferred way to call a javascript function?
    Do it using addLoadEvent() or Windows.Load etc
    OR
    Call it thru Xsl? (I donno how to do dis)
    Thanks in Advance..
    Edited by: ranjjose on Jun 3, 2008 8:21 AM

  • Error when calling SOAP Runtime functions - Please help!

    Hi,
    Very new to SAP. I just installed SAPNW7.0ABAPTrialSP12 (sandbox server, with default options) and setup the
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/db/7c623cf568896be10000000a11405a/content.htm">Flight Data</a>.
    I wanted to invoke some of the Flight Data functions through SOAP. So I invoked the following URL:
    http://localhost:8000/sap/bc/srt/rfc/sap/BAPI_FLIGHT_GETDETAIL?sap-client=000&wsdl=1.1
    I get the following error:
      The following error text was processed in the system NSP : Error when calling SOAP Runtime functions
    The error occurred on the application server hs_NSP_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
          Method: HANDLE_REQUEST of program CL_SOAP_TRANSPORT_EXTENSN_ROOTCP
          Method: HANDLE_REQUEST of program CL_SOAP_HTTP_EXTENSION========CP
          Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_SOAP_HTTP_EXTENSION========CP
          Method: EXECUTE_REQUEST of program CL_HTTP_SERVER================CP
          Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
          Module: %_HTTP_START of program SAPMHTTP
    FROM Runtime Error Log:
    Runtime Errors                     UNCAUGHT_EXCEPTION                                                          
    Exception                          CX_SOAP_CORE
           Termination occurred in the ABAP program "CL_SOAP_TRANSPORT_EXTENSN_ROOTCP" -                
               in "HANDLE_REQUEST".                                                                               
    The main program was "SAPMHTTP ".                                                                               
    In the source code you have the termination point in line 37                                 
              of the (Include) program "CL_SOAP_TRANSPORT_EXTENSN_ROOTCM004".
    Does anyone have any ideas on what is going on? Thanks in advance.

    Hi,
    Have a look at this blog from Michal Krawczyk to find a solution:
    The specified item was not found.
    Hope this helps,
    Grzegorz

  • Where to call the javascript function

    Hi,
    I am using JSF and ADF.
    I have a javascript function called by the body onload.
    The javascript is to set the first the first column of a table fixed.
    But when I click the next page link which is generated by defaut,
    the function from the javascript disappears.
    Can I call a javascript function when pressing the next page link which is
    generated by default ?
    Thanks.
    Ivan

    Hi Frank,
    My javascript function is to make the first column of the table fixed which
    is something like the function in the Excel.
    The function is called by body onload.
    But when the 'next page' link is clicked, it will not refresh the whole page.
    The above cannot be called.
    So I wanna add it during the action of pressing the link.
    any alternatives ?
    Ivan

Maybe you are looking for

  • Messaging app that works with 2nd generation ipod touch

    I recently downloaded imessenger to my 2nd generation ipod touch but it was hours later and with the help of this forum, that I discovered it is not possible to use with my iOS.  Does anyone know of a texting app that I can use?

  • How do I get this query into Discoverer Plus

    Hi all, I have the following query: SELECT h.hrs, NVL(Quantity, 0) Quantity FROM (SELECT TRIM(to_char(LEVEL - 1, '00')) hrs FROM dual CONNECT BY LEVEL < 25) h LEFT JOIN (SELECT TO_CHAR(event_date, 'HH24') AS during_hour, COUNT(*) Quantity FROM user_a

  • SQL Loader Messages in Java (What do they mean?)

    Hi, I have been able to execute SQL Loader from a Servlet and I have also been able to retrieve the exit code by calling {returnCode = process.waitFor()}. I know that a "0" in the exit code indicates a successful execution. However what do the values

  • Working with a fresh installation, need help...

    So my MacBook pro is running some pro software such as Adobe's creative web suite and VMWare's Fusion, and I have been experiencing poor performance issues since these were installed. I've been recommended by a Genius to re-install fresh. Thanks to M

  • Keyboard shortcuts CS4

    Where can I get the english keyboard shortcuts for Fireworks CS4? I have the french version installed and I when I read an english tutorial its way less complicated to follow with the english shortcuts. thanks