I need An Auto Refresh Javascript function able to accept argument

Hi,
I have developed a chat application with time based autherization.
I am trying to send the time difference as an argument ot the onload() function.
But the function is not accepting the argument inside javascript.
can any one help me out

Java is not the same as Javascript!!!!!!!!!!!!!

Similar Messages

  • 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.

  • A swf in an iFrame calling javascript function on Parent page

    I have a .swf that has to load in a iFrame and needs to call a browser cookie javascript function that lives on the parent page that loads the iFrame.
    I'm using this:
    ExternalInterface.call("javascriptFunction");
    but of course this call is not making it to the Parent page javascript function.  Is this possible to do?
    Thanks!

    The parent page has the javascript function, and has a iFrame that loads the swf.  The swf needs to call the javascript function that lives in the parent page.
    Thanks!

  • LOV's auto refresh and having unique values.

    Hi, I'm having LOVs connected with few attributes of a table, and those fields are used in view criteria of the table.
    This view criteria is used in the af:query component as search fields.
    To avoid the duplicates in the LOV, i created a separate view for each of the attribute, using the distinct key , and connected them with the attribute via view accessors. So that the af:query component , search field drop downs can give unique value of the column.
    There is an another requirement, to refresh the LOVs of the search field, when there is a change in the database. To accomplish this auto refresh property of the view's query, i added the PK of the table with each view. By doing this i can see the latest values of the database in the UI . ie, the LOVs of af:query getting the changes of database.
    But this one causing, the duplicate values to be in LOV, and the distinct key word in the view's query will not work because of the PK of table is added to query.
    I tried different ways to query , like groupby . But no success.
    I need both auto refresh as well as unique values in the LOVs of the af:query . Could some one point me a reference to solve this. Thanks .
    Edited by: user642477 on Oct 7, 2010 10:52 AM

    user642477 wrote:
    Hi, I'm having LOVs connected with few attributes of a table, and those fields are used in view criteria of the table.
    This view criteria is used in the af:query component as search fields.
    To avoid the duplicates in the LOV, i created a separate view for each of the attribute, using the distinct key , and connected them with the attribute via view accessors. So that the af:query component , search field drop downs can give unique value of the column.
    why you have done that what is your reason?!!! it seems so wierd to me? you could easily add distinct on query of the viewobject!

  • 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.

  • Passing text including special characters to Javascript functions

    I need to call a Javascript function with some text retrieved from the database, which may include carriage returns, line feeds etc. I need to change these to the Javascript escape characters "\r", "\n" etc. I can easily write my own function to do this, but suspect there may be a built-in one somewhere I could be using - but can't find one. Is there one?

    Tony,
    I tried using XMLDB_GEN.CONVERT and it worked for me:
    DECLARE
       v_value_to_save   VARCHAR2 (30);
    BEGIN
       v_value_to_save := DBMS_XMLGEN.CONVERT (:t_sql, 1);
       UPDATE my_table
          SET my_column = v_value_to_save
        WHERE my_key = :my_key_value;
    END;
    DECLARE
       v_value_to_select   VARCHAR2 (30);
    BEGIN
       OWA_UTIL.mime_header ('text/xml', FALSE);
       HTP.p ('Cache-Control: no-cache');
       HTP.p ('Pragma: no-cache');
       OWA_UTIL.http_header_close;
       FOR c IN (SELECT my_value
                   FROM my_table)
       LOOP
          v_value_to_select := DBMS_XMLGEN.CONVERT (c.my_value, 0);
          HTP.prn (v_value_to_select);
       END LOOP;
    END;
    /Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Browser Javascript call Acrobat Javascript function

    What I want to do is call a function in Acrobat Javascript by clicking a button in my browser.
    So if you click the browser button it executes a javascript function that calls an acrobat javascript function.
    I found this example:
    Browser javascript
    function printDocument() {
         var pdfObject = document.getElementById(\"PDFObj\");
         pdfObject.postMessage([\"alert\", \"Hello from HTML\"]);
    Acrobat javascript
    In the secure folder (C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts\kassa.js) my folder level script
    so this is executed for each pdf document.
    this.hostContainer.messageHandler =
         onMessage: function(aMessage)
              for(var i = 0; i < aMessage.length; i++)
              console.println("Recvd Msg[ " + i + "]: " + aMessage[i]);
          onError: function(error, aMessage){ },
          onDisclose: HostContainerDisclosurePolicy.SameOriginPolicy
    This should do the job...
    But if i look at the javascript debugger window(acrobat)
    it shows:
    this.hostContainer has no properties
    9:Folder-Level:App:kassa.js
    this.hostContainer has no properties
    9:Folder-Level:App:kassa.js
    Any solution for my problem?

    hi levi,
    Thank u very much for responding,
    to be precise i have to show the user a small window saying that the excel sheet is being prepared and once the sheet is prepared this window has to be closed. So to open and close this child window i need to use the javascript functions.
    currently my jsp looks this way
    <script>
         function open()
         funciton close()
    </script>
    <body>
    <script>
         open();
    </script>
    include x.jsp //sets the content type to excel
    include y.jsp //writes to the excel sheet
    <script>
         close();
    </script>
    <body>
    My x.jsp looks this way
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "filename=" + "abc.xls");
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader("Expires",0);
    response.addHeader("Cache-control", "no-store");
    response.addHeader("Cache-control", "max-age=0");
    The issue is the javascripts are not getting called at all. Is there any other way to solve this. Since i am the beginner in this field i dont have much idea about this. A code snippet will be of great help.
    Thanx

  • UWL Auto refresh after processing workflow task

    Dear All,
                    We are developing custom Java webdynpro application.  I Have a requirement where I need to auto refresh the UWL once the user process the task.
    Say if the User approves a leave req, the UWL has to get refreshed automatically. (Only for certain task not for all).
    Please let me know the possible ways in achiveing it.
    Can I
    1) Configure in <Itemtype Tag> where I re-register. Can I edit the xml to achieve it?
    2) Can we use the UWL lib/methods to do a auto refresh once the application is process successfully..
    Please advice..
    Thank you
    - Senthil Bala
    Edited by: Senthil Bala on May 30, 2008 3:49 AM

    Hi,
    Editing the XML is a good solution rather than modifying the uwl par or creating custom UWL.
    Thanks,
    gopal

  • DotNet Web Controls 3.0 Auto-refresh Adaptive portlet javascript error

    Hi-
    I am getting this javascript error: "A Runtime Error has occurred. Error: 'PTLoader' is undefined", when trying to run a Auto-refresh portlet in Plumtree 6 with DotNet Web Controls 3.0
    Thanks,-Raj

    PTLoader is a separate JS library; not part of the .NET Web Controls. I expect that you are using this JS object but have not put the required JS file on the imageserver.

  • Need help setting up auto-refresh

    Hi,
    I need help figuring out why auto-refresh is not available in my situation:
    I have a SQL Data source with the following settings:
    Status
    Ready
    Gateway
    Cloud Access
    <label data-bind="text: DataSteward.Sections.DataSources2.Converters.booleanEnableFormatter(EnableCloudAccess())" id="info-cloudaccess-label">Enabled</label>                        
    OData Feed
    Enabled
    Then I created a spreadsheet with Power Query table and Power View chart. Power Query is using one and only view enabled in the data source. Data table has been added to the data model.
    Now, when I upload the spreadsheet to Power BI site, then enable it for Power BI and try to setup the auto-refresh, I get the following:
    You can't schedule a refresh for this report because it contains no data connections.
    Technical Details                        
    ▼                    
    Correlation ID:                         
    bac4d3a0-dc11-4543-99de-eff2fb0c5d47                    
    Date and Time:                          
    03/16/2015 04:35:28 AM (UTC)
    The report surely contains data connections (under DATA > Connections). Please advise as this is quite confusing. Thanks.

    Hi Mini,
    Thanks for getting back. Your workaround helped a lot. Now I can see the auto-refresh settings. However, when I try to "test connection" under the auto-refresh settings, it is giving me the following error:
    OnPremise error: Sorry, the data source for this data connection isn't registered for Power BI. Ask your Power BI admin to register the data source in the Power BI admin center. Correlation ID: 4d4a7553-1177-43f3-9afd-14bd1b0263ec
    The data source is configured the following way:
    Enable cloud access = yes
    Searchable in Power Query = yes
    Enable OData feed = yes
    Data source type = SQL Server
    Please advise as the error message is misleading. Thanks a lot.

  • Auto-sleep won't work when web pages auto-refresh

    Dear Apple,
    Around 4 years ago, I noticed that my computer stopped going to sleep. I first noticed it shortly after adopting Gmail for my email platform and was subsequently able to isolate the issue down to Gmail and other websites, such as Huffington Post, which auto-refresh. Apparently, any website that auto-refreshes at shorter intervals than the auto-sleep is set to kick in, prevent the computer's auto-sleep function from activating.
    I have spoken at length with AppleCare about this issue and understand that this is "by design." For instance, we wouldn't want the computer to constantly go to sleep while watching a movie or downloading and conversely, if we are actively working at our computers it's nice that Gmail auto-refreshes and keeps us appraised of incoming mail. However, since the vast majority of users now leave their browsers with multiple tabs open and due to the fact that more and more websites now auto-refresh, the auto-sleep function has become outdated and non-functional. While users can always manually put their computers to sleep, everyone at some time or another forgets to do so. This is exactly why computers are supposed to auto-sleep in the first place. Aggregated across millions of users, this results in a huge waste of electricity.
    I've been writing/calling Apple (through AppleCare and the online feedback form) about this issue for 4 years now. I keep hoping that with each operating system release, some sort of "smart auto-sleep" function will be incorporated that will recognize when websites auto-refresh and still allow auto-sleep to kick in. Unfortunately, this does not appear to be the case in Lion.
    I work in the energy efficiency field, specifically in lighting, and care deeply about this issue. I consider Apple to be an industry leader on this issue as well. I'm not familiar with the technical side of this issue, but I assume that with the right type of programming, the operating system could override a webpage's auto-update feature and activate auto-sleep, while not interfering with functions where a user would not want the computer to go to sleep, such as watching a movie. With Lion, Apple has focused its energy on making the computer adjust to the user,rather than the user adjusting to the computer. Yet, in this case, it appears to be the other way around.
    It is time for Apple to update the auto-sleep function so that it takes into account websites that auto-refresh. When I set my computer to auto-sleep after so many minutes, I want it to do so, regardless of whether I have a browser with auto-updating websites open. Apple must take this issue seriously, as the wasted electricity is too important to ignore any longer.
    Sincerely,
    An Energy-Conscious User

    I am obviously talking to Apple AND I posted this letter here, because a lot users seem confused about why their computers won't sleep. Even most AppleCare reps are confused. In the past, I couldn't find much in the way of explanations pointing to this issue, so I thought I post it here in case other people are looking for an explanation.
    The auto-sleep function was built before websites auto-updated and needs to be updated to accomodate them. For the average user, it doesn't make sense for the computer not to sleep just because Gmail is open. Just because some website auto-refreshes in my browser, doesn't mean I never want my computer to sleep. By the same token, if I wanted to turn off auto-sleep I could easily do so from within Energy Saver Preferences. The two should be independent, so the user has the choice.
    Why should I have to close my browser every time I walk away from my computer in order for it to sleep? I've acknowledged that in certain circumstance it makes sense for the computer not to auto-sleep: watching a movie, uploading, etc, but Apple has already accounted for those instances because the computer does not auto-sleep when those programs are running. All I'm suggesting is making the auto-sleep mechanism more sophisticated so that it isn't overridden by websites auto-refreshing. 
    Why the negative attitude, dwb? Based on the amount of time you spend in these discussion forums, you obviously never turn your computer off, so this doesn't really affect you. Maybe it's time to step outside and get some fresh air?

  • Auto Refresh OBI Page for Current Day Only

    Hello Guru's
    I have a obiee page which needs to get refreshed every 30 seconds . I could able to do that using <META HTTP-EQUIV = "REFRESH" CONTENT = "30"> . But the triggy part is , auto refresh needs to be applied only for current day and not for any date range selected by user .
    Details :
    Prompts are defaulted to current date and time on the page, but user can also select date ranges as well . So the setting for auto refresh needs to apply only on current date (default prompt values) and not if the the user select data range .
    let me know if any of you guys have come across such .

    Check the below link and tweak it if needed.
    http://www.cool-bi.com/Customize/AutoRefresh.php
    Appreciate if you mark as correct :)
    Let me know for issues
    Edited by: Srini VEERAVALLI on Jan 4, 2013 10:46 AM

  • Set multiple items with javascript function in chart link

    Hi Folks
    I am able to use the javascript $s function to set the value of one item from a chart link. I need to pass values to multiple items.
    Is there a way to use javascript function to pass values for multiple items on a page from a chart link
    Appreciate your responses
    Thanks
    Gopal

    Hi Arnau,
    You need to surround your JavaScript code like this (without the spaces before and after script):
    < script language="Javascript">
      window.open("<%=ABAP_VARIABLE%>").focus();
    </script >
    Regards,
    Patrick.

  • Using Excel 2007 to display and auto-refresh planning.

    Hi all,
    a customer wants to display a simple planning screen on a 24" monitor.
    We're using an old domain pc, with domain user (planning) logged on to display the planning file.
    We've configured the worksheet so that multiple users can edit it.
    I've also found the settings which auto-update the file. I was amazed that this is standard functionality.
    Although, it doesn't work as we expected. It goes well, but when too much users work in the file, some users still get the error message: 'can't open file because it's already in use'.
    This does NOT happen when the file is not constantly opened by the 'planning user'.
    So that's one issue, probably caused by the 'planning user', having the file opened 24/7.
    Another issue is that the file stops auto-refreshing after a while. I didn't find any pattern in that.
    So basically, what the customer needs is:
    Display Excel worksheet
    Auto-refresh
    I've found some nice articles about SharePoint and Excel services, but unfortunately they're running SharePoint 2010 Foundation, which does not include Excel services...
    Is there any other way or tool to achieve this, without using the Excel-built-in options?
    Or maybe there's a fix for that problem?
    Thanks in advance.

    Hi LunAds,
    I'm afraid you have just discovered how bad these features are implemented in Excel: they just don't work properly and I always advise against using them for any serious long-term solution.
    If you do not have Excel services, then editing the document on the server (which would prevent lots of problems) is out of the question indeed.
    Alternatives depend a lot on your needs.
    For example, you could use sharepoint lists that the users can edit and then import those lists into Excel for reporting purposes.
    But if this is relational data (parent-child tables, which is very often the case) then a database solution is probably the best route to take.
    Regards, Jan Karel Pieterse|Excel MVP|http://www.jkp-ads.com

  • Binding to a javascript function is not working

    I am trying to use the following code to bind to a javascript
    function and it's not working. I finally had to use jQuery to bind
    the event handler, but I would like to see the CF generated stuff
    work. Am I missing something here?
    This jquery code is the workaround:
    $('.match').change(function(){
    updateSA(this);

    Binding is not restricted to flash forms. I can bind directly
    to a cfc without problems, but in this case I need to send more
    info to the cfc than a single field would provide. You're supposed
    to be able to bind to a javascript function using the syntax above,
    but it's not working properly.
    More details here:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=ajaxdata_03.html#1128486

Maybe you are looking for

  • Startup gets 'Network cable unplugged' on mini-PCI wireless card

    I recently installed a Netgear DG834GT wireless router and now have an intermittent problem connecting my Tecra 9100 to it. If the 9100 has been shutdown for a while (like overnight), when I restart I always get 'Network cable unplugged' for the wire

  • How to display button when movie ends

    Hello! I made a short movie in After Effects and now I'm trying to add some buttons to it. The movie starts with an intro and when that ends a "continue" button should appear and take you to the next part. My idea was to place a screenshot of the las

  • Making CCV field in checkout mandatory for on site credit cards, but not for getting to Pay Pal site

    Hi.  I posted this on December 1st and am still waiting for a response after a failed attept with chat. When my clients are making an order, the CCV field, even though it is marked as required, they can actually place an order without entering the CC

  • Amaya 8.3-1 won't start, still. :)

    I already posted this to the bug reports, but wanted to bring it up here to see if there was anyone else experiencing this problem, or if anyone had a fix: http://bugs.archlinux.org/index.php?do=details&id=680 On trying to run amaya from xfce termina

  • Reverse engineering a sync

    Commputer was stolen, how do I recreate the library on a new computer from the 200 gigs on my iPod?