Comparison of JavaScript bug

So I found a weird Javascript bug and was hoping someone could help me.

If say

var value = 40;

var smallervalue = 8;

If (value<>

doSomething;

}

It always seems to work for some reason any even if 40 is > 8. This bug seems javascript is compared only the first digit of the report number to the integer value of the number. I m also using a 'table' for the value for the 'small' in my actual code. Could someone help me debug this? Thank you very much!

I'll take a hypothesis that you end up with a string comparison.   One of the sillier confusions of JS.   Anyway try

If (+ value< +smallervalue).="">

Tags: BlackBerry Developers

Similar Questions

  • Dynamic action - two types of options of "condition"?

    I would like to create a dynamic action that runs when a SQL condition exists is met.  If this is the case, then it will run several true Actions.  If this isn't the case, it will run several wrong Actions.

    I see there is an option of Condition in the when section of her DA, however, seems to be limited to static value comparisons or Javascript.  There is also another section of Condition where you can select SQL exists or various other PL/SQL expressions.  What is the difference between these options two condition?

    Also, when I set the status section to Exists and in the SQL query include an equivalence to an element of the page it does not seem to recognize the value of the page element. For example:

    Select * from my_table

    where PARTY_NUMBER =: MY_PARTY_NUMBER

    It still fails the condition even when a valid part number is entered on the page (him DA is run when MY_PARTY_NUMBER is changed).  I should be able to enter a reference point of page here, Yes?

    Thank you

    Steve

    P.S. I use 5 APEX

    Steve. 1234555 - Oracle wrote:

    I would like to create a dynamic action that runs when a SQL condition exists is met.  If this is the case, then it will run several true Actions.  If this isn't the case, it will run several wrong Actions.

    I see there is an option of Condition in the when section of her DA, however, seems to be limited to static value comparisons or Javascript.  There is also another section of Condition where you can select SQL exists or various other PL/SQL expressions.  What is the difference between these options two condition?

    Also, when I set the status section to Exists and in the SQL query include an equivalence to an element of the page it does not seem to recognize the value of the page element. For example:

    Select * from my_table

    where PARTY_NUMBER =: MY_PARTY_NUMBER

    It still fails the condition even when a valid part number is entered on the page (him DA is run when MY_PARTY_NUMBER is changed).  I should be able to enter a reference point of page here, Yes?

    N ° you won't achieve what you're trying to do. The standard Condition section in dynamic action controls if the code of the dynamic action is rendered the see page. It has no impact on the question of whether the actions of true or false are performed during the intervention of the user. Control conditions which are those defined in the when the properties of the dynamic action. As they are evaluated in the browser, they must be specified as JavaScript.

    To perform actions conditionally based on the existence of rows in a table requires DA type body of the PL/SQL function or SQL, submitting the values of the requested page, runs the necessary query and returns a value to an element of [probably hidden] page, followed by either an action to run Javascript Code containing conditional logic , or another DA triggered by a change on the hidden element event.

  • If &amp; then calculation

    Hello Experts!

    I have a knowledge base, but need help. Creating a page buget and need assistance of som as follows:

    Variable inputs:

    Area 1: Expenses amount (for example: $100.00)

    Field 2: Drop-down list with the following:

    1. " - "

    2. "weekly".

    3. "monthly".

    4. "per year".

    Fixed results:

    Area 3: Give the weekly expense

    Area 4: Give the monthly expense

    Area 5: Will give the annual load

    In summary, no matter what either the frequency of admission (weekly, monthly, yearly), the formula will calculate all the three results IE weekly, monthly and annually.

    Thanks in advance guys.

    Nick

    OK... the thing down sweater could get rather complicated and send round you in circles, but your code looks quite plausible. However, I see an error that hangs on everyone.

    To see if the values are equal, never, never just use the "equals" sign = because it does not have what you think and breaks everything!

    Use two equal signs if (v2 == "monthly"). More information: comparison of JavaScript and logical operators

    Other problems: there are two lists of names of things. One is the name of the field (amount, frequency) and one is the name of the variables (v1, v2). You connect with getField, but you can never use the domain names in JavaScript otherwise. Then note that when you write amount / 52 and so on, you need to use the variable name, not the name of the field.

  • If statement error

    I was hoping that someone could help me with this problem.

    I have a code one of my fields, but needed to do an "if" statement to get some results.

    This is the original code that I got:

    var a = this.getField ("Text8");

    var b = this.getField ("Text59");

    (Event.Value = Round((a.value/b.value), 1);

    If the field told 77.3 then that I wanted to change to 77.4. I thought that adding the following if exposed to the code would work, but it just displayed "77.4" in the field.

    If (event.value = 77.3) {}

    Event.Value = 77.4;

    }



    I'm still learning JS, so I don't know what everything means. Any help would be greatly appreciated.

    Thank you

    The comparison in JavaScript operator is "is" and not "=" - use the following line:

    if (event.value == 77.3) {
    
  • Select formfield listvalue and autopopulate

    Hi, hope someone can help me with this one.
    I need to select a value in a list and then fill another Formfield with a specific value depending on what I selected in the list, in this case e.g. number of 1995 if I select the '12' in the 'Formfield_1' selectionlist value must be filled with the 1995 value and if I select the "18" in selectionlist value , the "formfield_1" must be autopoulated with the number 2995 I, how to solve this?

    example:

    var a = this.getField("SelectionsList").value = 12;

    var b is this.getField("SelectionsList").value = 18;.

    var c = this.getField("Formfield_1").value;

    If (a = '12') event.value c = '1995 ';

    If (b = "18") c event.value = "2995;

    As you can se, I have trouble understanding how to get and fill the value in the var c

    I chose to run it as a calcutlation of the properties 'Format' tab and Custom keystrokescripts in the selectionsList, perhaps it should not be placed there at all?, I want her to do the calculations when a selection is made through the SelectionsList

    Lesson #1: Java and JavaScript are NOT the same thing.

    Lesson #2: In the PDF files, you use only JavaScript code.

    Lesson #3: The comparison in JavaScript operator is "is." The value assignment operator is '='.

    If your code should be something like this:

    var a = this.getField("SelectionsList").valueAsString;
    if( a == "12") event.value = "1995";
    if( a == "18") event.value = "2995";
    

    Edit: fixed the last line of code

  • Buttons that cause the window to close in IE8

    Hello

    I have a weird bug that seems like it should not be possible.  I use 6 Captivate and SCORM 2004 edition as a .swf.

    I created a presentation of captivate with several software simulations incorporated in it as animations.

    The slides containing these simulations are break through a mostly empty widget hidden behind the animation.

    Each simulation starts with a button start this progress simply to the next slide and ends with a button continue with a javascript function that moves the presentation of the parent to the next slide.  That javascript is:

    function nextSlide() {}

    var objCP = document. Captivate;

    objCP.cpEISetValue ('rdcmndNextSlide', 1);

    }

    nextSlide();

    Each of the six software simulations has the Start button and keep even that was copied and pasted from the first.

    All works perfectly in Chrome, except that JavaScript works only when the project is published on the LMS.

    However, in IE8, I encountered a very strange problem.  Some buttons work as expected, but a few of them cause the window IE8 containing the presentation to close without warning or error.  Non-working buttons remain consistent and continue to have problems even after many republishings, and even after recreate both the buttons and the slides containing simulations.

    When I run it locally, he throws the following errors when I click on one of the buttons to bad:

    49:Wed July 3, 10:44:06 EDT 2013 - unloading

    50:Wed July 3, 10:44:06 EDT 2013 - ClearErrorInfo

    51:Wed July 3, 10:44:06 EDT 2013 - ExecFinish, ExiType = SUSPEND

    52:Wed July 3, 10:44:06 EDT 2013 - ClearErrorInfo

    Anyone has any ideas on this?

    Thank you

    Brian

    Looks like you hit the JavaScript bug found here:

    http://captivatedev.com/2012/12/17/display-the-students-name-from-your-LMS-using-Adobe-cap market-6-x.

    and more info here:

    http://www.cpguru.com/fix-for-the-Adobe-Captivate-6-JavaScript-bug/

    This problem has been resolved in Cp 7.0.  What version do you use?

  • After updating to Firefox 15 it crashes at the end of a javascript call window.close (); opener.alert ('test'); Does work as expected or is this a bug?

    After updating to Firefox 15, it crashes after a popup called javascript window.close (); opener.alert ('test'); Does work as expected or is this a bug?

    It works better if you disable the modal prompt temporarily as a test by setting prompts.tab_modal.enabled false on the subject: config page?

  • Execution bug JavaScript setTimeout loop trying to fade.style.opacity += 0.1.

    Execution bug JavaScript setTimeout loop trying to fade.style.opacity += 0.1. He works with negative = operator but not with a positive operator +=. Browser (Firefox 11) just keeps telling me that the opacity is 0.1 all the time.

    Here is my code:

    function setOpacity() {
    	i++;
    	if (dir == 1)
    	{
    		fade.style.opacity -= 0.1;
    		if (fade.style.opacity < 0.1)
    		{	dir = 0;	}
    	}
    	else
    	{
    		fade.style.opacity = fade.style.opacity + 0.1;
    		if (fade.style.opacity > 0.9)
    		{	dir = 1;	}
    	}
    	document.getElementById('opacity').innerHTML = "Opacity: " + fade.style.opacity;
    	document.getElementById('dirr').innerHTML = "dir = " + dir;
    	document.getElementById('i').innerHTML = "i = " + i;
    	t = setTimeout("setOpacity()",100);
    }

    So if I change the operator += =, opacity continues to change. I am sure that the problem must be in Firefox, because with IE all kept going even with the operator +=.

    The problem seems to be that the opacity value is not considered to be a float.

    Use them instead:

    fade.style.opacity = fade.style.opacity*1 - 0.1;
    fade.style.opacity = fade.style.opacity*1 + 0.1;
    

    You can opt for document.getElementById ('bland') instead of the identifier for fade to avoid warnings in error Console.

    WARNING: The Element referenced by ID/NAME in the global scope. Use rather document.getElementById (standard) W3C.

    Source file: http://greenpark.fi/js_fader.php

    Online: 23

  • External file of Javascript Ghost (bug?)

    Hi, this is a sensitive issue (at least for me):

    I created a Javascript file, we will call "test.js", I downloaded for shared components-> static files without request repository associated in particular.

    This file it is referenced by the X page with NO cache setting on the Javascript-the URL of file like this: #WORKSPACE_IMAGES #test.js

    So far so good, the functions of the library was called and executed correctly.

    But I stumbled upon a small bug in the file I have proceeded to correct and then change in the downloaded version of the file (less than 30000 bytes file, I was able to change on the spot, hit apply changes). After that, I deleted temp files and history on the browser. However when I run the page again the error continues, because, as shown in the console, the file being used is the precedent, not the version fixed. A little weird... okay, but that's not all, I have decided to remove the file from the repository and upload it again (same name "test.js") with no application associated with, once again, delete the temp files and history on the new browser and run the page (once again ). And once again (hehe...) the error persists and the file called is the one that does not exist. So finally I decided to do a bit of magic to deceive and delete the file but not download, leaving the reference to #WORKSPACE_IMAGES #test.js on page properties, delete history and the temporary file to the browser and run once more, this time decided to break the page, and yet it works!, wrongly is the buggy file but it's there! , so I said: "ok, browser problem... run it on Chrome (for the first time) and the file is there, so I said: 'ok, machine question..', run it on a new computer (for the first time) and the same non-existent buggy file and it is been charged...

    This file, it is not referenced by another application (yet). The runtime is file to the url that does not exist:

    http://192.168.141.14/Apex/wwv_flow_file_mgr.get_file?p_security_group_id=3321831433497474 & p_fname = test.js

    I downloaded the same file under a new name Let's say test_1.js and change the page indicated under this new name, then the page load the new correct file. But this is not a desirable behavior, that I got the chance that it was the first reference to the file, but if it happens at a later stage, it would be a major problem.

    Sorry for making it a bit wide but I tried to be thorough with this, I missed something? Why is this happening?  Any help will be appreciated.

    I use:

    • APEX build 4.2.3.00.08

    Database

    • CORE Production 11.1.0.7.0
    • NLSRTL Version 11.1.0.7.0 - Production
    • Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    • PL/SQL Release 11.1.0.7.0 - Production
    • AMT for Solaris: 11.1.0.7.0 - Production Version

    I had the same problem some time ago, you can see the solution on this thread:

    CSS referencing of components shared/Cascading Style Sheets

    Thank you

    Erick

  • Bug in comparison

    Hi all

    There is a good one, which may have an obvious answer (and that's the reason why I first decided to ask here before filing a bug).

    < cfset t1 = ToString("00237000000075384887") >

    < cfset t2 = ToString("00237000000075384892") >

    < cfif t1 t2 EQ > < equal cfoutput > #t1 # #t2 # < / cfoutput > < cfelse > < different cfoutput of #t2 # #t1 # > < / cfoutput > < / cfif >

    The result of the above is rather surprising. Just this kind of comparison think the numbers are equal. In addition, even if the two numbers are converted to strings, ColdFusion still think they are equal.

    If you use Compare(t1,t2) However, ColdFusion starts by comparing the chains that we humans and distinguish between them

    Now if there is no known limitation to compare the long numbers etc. or the fact that the middle of each of them is filled with zeros affects everything, welcome to point out for me.

    Simon

    Do a google on "floating point precision.

    As CF is weakly typed, it must make some assumptions when it comes to what type operations is significant. The EQ operator is an example of this: If the CF can climb the operands of numeric values, it will be, which is what he does here. And when it converts strings into numeric values, both are 2.37000000075E + 017, so they equal.

    If you want to compare two strings explicitly as chains, then you must use compare(), as you might have already guessed.

    There are no surprises in everything you see.

    --

    Adam

  • Apex bug 4 JavaScript API documentation

    Hello

    The JavaScript API documentation have exactly same description of functions
    $f_Hide_On_Value_Item
    $f_Show_On_Value_Item
    >
    Verifies that the value of the item page (pThis) against a value (pValue). If it matches, a DOM (pThat) node is set to hidden. If it does not, then the DOM (pThat) node is visible.
    >

    And also the functions have same description
    $f_Hide_On_Value_Item_Row
    $f_Show_On_Value_Item_Row
    >
    Checks the value (pValue) of an element (pThis). If it matches, this function hides the table row that contains (pThat). If it does not, then the row in the table appears.
    >

    I think that is not correct
    http://download.Oracle.com/docs/CD/E17556_01/doc/apirefs.40/e15519/javascript_api.htm#CHDHIAJB


    Somehow, I remember he's has had to post about it, but I'm not.

    Kind regards
    Jari

    The description of these functions have been fixed. The most recent version of this document is now available on the technical network (OTN) Oracle.

    Please report the bug,
    Coarse Swaderner

    Senior technical editor

  • Type of comparison bug?

    Hello

    My Flex/AS3 application traverses an array and checks the contents. Very simple task so far. Now, if I assign for example
    myArray [6] = 0; The following statement returns the value true: if (myArray [6] == "") {...} Although the direct comparison would never be.
    Is this a known bug?

    Alex

    It is not a bug.
    You try to compare two values to Boolean return false. That is to say
    Boolean (0) = false and Boolean("") = false then false == false returns true.

    Try again with the sign of the strict equality: (3 equal signs)
    If (myArray [6] = "")

  • Infinite scroll (javascript) seems to bug after 14.0.1 update

    Web page calls script as follows:

    <script type='text/javascript' src='/helpers/js/infinite.js'></script><script>var getNext=6;var pgn = 5;setInterval(scroll, 1000);</script>

    Infinite.js is a simple ajax call that reads the next articles [pgn] from [getNext]. After the upgrade to 14.0.1, the script doesn't seem to load with the page. When I switch on console, it takes up to 30 seconds for the script to load and run, after which the feature is as before. This problem is specific to Firefox and occurs only for the upgrade. All platforms (Mac, Windows) are concerned.

    Well, I tried my own medicine and can't get the script to work in Mode without failure. Hah! My apologies for blaming your system.

    The problem seems to be the Google font. You have this in your page:


    <link href='http://fonts.googleapis.com/css?family=Josefin+Sans' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Quattrocento+Sans' rel='stylesheet' type='text/css'>

    Important these style sheets:


    @font-face { font-family: 'Josefin Sans'; font-style: normal; font-weight: 400; src: local('Josefin Sans'), local('JosefinSans'), url(http://themes.googleusercontent.com/static/fonts/josefinsans/v3/xgzbb53t8j-Mo-vYa23n5nhCUOGz7vYGh680lGh-uXM.woff) format('woff'); }

    @font-face { font-family: 'Quattrocento Sans'; font-style: normal; font-weight: 400; src: local('Quattrocento Sans'), local('QuattrocentoSans'), url(http://themes.googleusercontent.com/static/fonts/quattrocentosans/v5/efd6FGWWGX5Z3ztwLBrG9b2aU247V0zTzydO4RoO9Ok.woff) format('woff'); }

    For some reason, the infinite.js is not kick in for me when I'm hosting these fonts load. (Normally NoScript blocks downloads of fonts of the sites that I have not previously defined on "of trust".)

    We prefer that you could switch to experience this:

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the filter box, type or paste gfx and make a pause so that the list is filtered

    (3) double-click gfx.downloadable_fonts.enabled to switch to false.

    (4) in a tab with the joelix.com site, use Ctrl + Shift + r to force a reload that bypasses the cache. Then, try the test Ctrl + end. Any change?

    So does that mean if it is correct? I'm not sure. Maybe something in the script is not designed for pages that change fonts?

  • [Bug]? Line and force the comparison Mode

    It seems that changing the Mode of comparison of the IR & C function with the tables or Clusters attached does not Type of spread, or anything that is responsible for the selection of the instance.  By example, if I combine three tables at the entrances of IR & C, change the comparison mode for comparing aggregates, and then create an indicator of the range in? output, the result is the wrong indicator and a cut wire.  Similarly, can I change the mode on a function IR & C with a wired in the range? output and it will not break the thread until a subsequent change triggers a recompilation or type of spread.

    LV10 (no SP1) and Win7.

    Hi Darin.K,

    I was able to reproduce the behvior you see in LabVIEW 2010 SP1. If the tables are entered and the comparison Mode is the change in the creation of 'Compare the aggregates' indicator will incorrectly create an array of Boolean flags wired to a single Boolean result.

    This was previously reported in a request for Corrective Action (RCA) and the behavior has been corrected in LabVIEW 2011. Thank you for taking the time to report the problem and apologize for any inconvenience it caused.

  • BUG: OS6 / JavaScript 'onclick' event when pulling ball control to help

    Hello

    I'm developing a web application targeting OS6 devices (torch and no key, for example Curve 9300). The problem is that an 'onclick' event does not fire when you use a Trackball to click on the object (torch and Curve 9300).

    It seems to be a bug (browser) OS6 as an "onmouseover" works without problem.

    ......
    
    var submitButton = document.getElementById('submit-button');submitButton.onclick = testOnClick;
    
    function testOnClick() {    alert('onclick never gets triggered by trackball, but when you touch the button it does!');}
    

    This causes a problem deploying the application to a mixed environment of OS6 devices.

    Someone else has a similar problem, or miss me something?

    Thank you

    Hi Sasha,

    I tried the code on the following simulators below:

    Torch 9800: 6.0.0.227, 6.0.0.246, 6.0.0.337

    Style 9670: 6.0.0.309

    NOTE: I couldn't find a simulator of 9300 with 6.0

    This code, everything seems to work properly on those built using the trackpad to move the pointer over the button and click it.

    Are maybe run you document.getElementById () in a script page that is not related to a document loaded event online?  I wonder if the purpose of the document is not yet loaded until you take a reference to it?

    
    
        
            
            Untitled Page
            
        
        
            
        
    
    

Maybe you are looking for