import of javascript

Hello im trying to import my javascript qml file...

using

Import "assets:///javascript/sha1.js" as sha1java

But if I import the file of the screen I use for it will not be able to push

the javascript code that I use has been

https://raw.github.com/KVZ/phpjs/master/functions/strings/SHA1.js

Anyone know the problem?

IM using the 10.1.0.338 SDK

found the solution...

for javascript using another folder must use '.. '.

cannot declare as a complete record even as 'assets:///javascript/utils.js '.

so using ".." moves to the top folder that is identical to the change management function

import "utils.js" like Utils

Thi are used on the javascript that even as the folder that the code that is running

Tags: BlackBerry Developers

Similar Questions

  • import of JavaScript instructions

    Hi all

    < code >
    import java.awt.*. *;

    Javax.script import. *;
    Javax.swing import. *;

    class c
    {

    /*-----------------------------------------------------------------------------------------------------*/

    Public Shared Sub main (String... args)
    {
    ScriptEngine engine;

    Engine = new ScriptEngineManager () .getEngineByName ("JavaScript");

    try {}
    Engine.put ("button", new JButton());
    System.out.println (Engine.eval ("instanceof java.awt.Component button"));
    }
    catch (Throwable t)
    {
    System.out.println (t);
    }
    }

    }
    < code >

    Is it possible to send statements of import to the engine, so that I don't have to write a full qualified class name (java.awt.Component)?

    Thank you

    http://download.Oracle.com/javase/6/docs/TechNotes/guides/scripting/programmer_guide/index.html

    Search for importPackage, importClass.

  • Import the Javascript library as a static file not work but working from URL

    Hi, I need to use the oCanvas library: download - oCanvas - oriented drawing canvas object in a page.

    I followed this guide: filing of APEX JavaScript static file

    I've downloaded the library and the updloaded in sharing of components/static files and referenced in the page header:

    < script src = "" #APP_IMAGES #ocanvas.js "type =" text/JavaScript"> < / script >"

    On the page, I created a html subregion and in the body, used the following test code:

    < canvas id = "canvas" width = "200" height = "100" > < / canvas >

    < script >

    output function (label, entry) {}

    var out = document.getElementById ("output"),

    input_string = ' ", i, number;

    If (typeof input = 'object') {}

    input_string += "{\n";

    for {(i input)

    number =! isNaN (parseFloat (input [i]))? true: false;

    input_string += ' < span class =------"tab\" > \t </span > ' + i + ":" + (number? ' ")". " "': ' \ '") + input [i] + (number? "": "\" "") + "\n";

    }

    input_string += '} \n ";

    }

    out.innerHTML += (out.innerHTML = ""?) ("": "\n") + label + input_string;

    }

    var c = document.querySelector ("#canvas"),

    CTX = c.getContext ("2d");

    c.Width = window.innerWidth;

    c.Height = window.innerHeight;

    c.addEventListener ("touchmove", function (e) {e.preventDefault ()}; false);

    var canvas = oCanvas.create ({canvas: "#canvas", the decoration: "#222" "});

    Planet Center

    Var Center = canvas.display.ellipse({)

    x: canvas.width / 2, y: canvas.height / 2,.

    RADIUS: canvas.width / 20,.

    fill: "#fff."

    ({. add()});

    Prototype that will be used to instantiate other objects

    var satelliteProto = canvas.display.ellipse ({fill: "#eee"});

    var pathProto = canvas.display.ellipse ({stroke: "1px #999"});

    Implement data

    satellites of var = [], depth = 3;

    var satelliteColors = ["#107B 99", "#5F92C0", "#c7509f"];

    var pathColors = ["#666", "#107B 99", "#5F92C0"];

    Create seven satellites and access roads. Definition is longer down.

    for (var i = 0, l = 7; i < l; i ++) {}

    createSatellite({)

    parent: focus, depth: 1,.

    distance: (i + 1) * canvas.width / 6,.

    RADIUS: canvas.width / 100,.

    Speed: 1

    });

    }

    Set up a tick function that moves all satellites each image

    canvas.setLoop (function () {}

    for (var i = 0, l = satellites.length; i < l; i ++) {}

    satellites [i] .rotation += satellites [i] .speed;

    }

    });

    Definition of a satellite and its corresponding path

    function createSatellite (options) {}

    Create the path which will follow the satellite

    var path = pathProto.clone({)

    Ray: options.distance,.

    x: options.x | 0, y: options.y | 0,

    strokeColor: pathColors [options.depth - 1]

    });

    options.parent.addChild (path);

    Create a new satellite

    satellite var = satelliteProto.clone({)

    origin: {}

    x: 0,.

    y: options.distance * (Math.round (Math.random ())?-1: 1)

    },

    Speed: Math.Random () * (2 * Math.Random () - 0.5) + 0.5,.

    Ray: options.radius,.

    x: options.x | 0, y: options.y | 0,

    filling: satelliteColors [options.depth - 1].

    rotation: Math.Random () * 360

    });

    options.parent.addChild (satellite);

    satellites.push (satellite);

    Create another satellite which will tour around the hub

    If (options.depth < depth) {}

    createSatellite({)

    parent: satellite, depth: + 1 options.depth,

    distance: options.radius * 7.

    RADIUS: options.radius / 1.5,.

    x: satellite.origin.x *-1, y: satellite.origin.y *-1;

    Speed: 10

    });

    }

    }

    Implement control of play/pause for the demo

    var text = canvas.display.text({)

    x: canvas.width / 2, y: 220,.

    origin: {x: 'Centre', y: 'Center'},

    filling: '#fff', size: 25, weight: 'bold', text: 'Play '.

    ({. add()});

    Canvas.bind ("click tap", function () {})

    Text.Text = canvas.timeline.running? 'Play': 'Pause '; Canvas.Redraw ();

    Canvas.Timeline [Canvas.Timeline.Running? "stop": "start"] ();

    });

    < /script >

    That does not work, but if I change reference from the page to the next header it works:

    <script src="http://cdnjs.cloudflare.com/ajax/libs/ocanvas/2.7.2/ocanvas.min.js"></script>

    What can I do to use the static reference correctly?

    It's a library problem?

    I created a test workspace, there are two pages with the static reference and the other with the URL reference, here's the connection info, if you want to try it:

    https://Apex.Oracle.com/pls/Apex/f?p=4550:1:0:

    workspace: ocanvas

    user: user

    Pass: ocanvas

    Thank you for your time.

    The file you have downloaded seems to have some formatting problems (missing CR/LF?).   I downloaded the same file from the remote site and referenced and it works.  Also, you can simply reference the file in the page URL of file header instead of add field tags in the html header scripts.

    -Jeff

  • onCreationCompleted shipped before import JavaScript is over

    Hello

    I have a very small QML that matters a little JavaScript (128 lines) file that matters in turn another small JavaScript file (80 lines). In summary QML--> JS A--> JS B. In the JS files are essentially class definitions, and some small global code running. JS files have zero dependencies of the QML.

    The problem is that when the rootComponent.onCreationCompleted signal is distributed on the QML, JavaScript dependencies are not ready yet.

    I get a lot of erros as:

    asset:///Test.qml:10: TypeError: Result of expression 'ONA.inst' [undefined] is not an object.
    

    I also use the reminder of the Qt.include, Qt.include ("b.js", function() {}), a.js wait b.js be fully charged to a.js.

    I expect the onCreationCompleted signal of the element root to be shipped after all imports of JavaScript and its dependencies, where it is fully charged.

    I use BlackBerry10Simulator-BB10_2_1-3502 with VM Ware Fusion 7, under Mac OS X 10.10.3. Unfortunately I have not access to any real device.

    Please advice.

    You can try RenderFence, add this code to your object of root (TabbedPane, Page or NavigationPane) instead of onCreationCompleted:

       attachedObjects: [
            RenderFence {
                raised: true
                onReached: {
                    \\ your code goes here
                }
            }
        ]
    
  • Banner of import

    I imported swf banners on my site and it works very well. Now, I want to do it on my iPad. Kind of Flash I diverted to html5 and exported to a js file. I thought that would work, but Muse can even import this file. Is it possible to come around that? I have on board, but I do not work in that. Edge solves the problem?

    Muse is not simply 'import' a Javascript file. You must first add the .js in the loading of a file, which will download the .js file in the folder "active". You will need to integrate the appropriate sections of the HTML file that was also created by Flash. And after that, it may not always work.

    However, Muse can directly import .oam files created by Edge animate - If Yes, Edge indeed solves the problem. Also, if you are familiar with Flash, animate dashboard should be a quick learner.

    Muse was created for the web designer, no coder. He's trying to protect the user form, have to do much, if any, coding.

  • Folio page layouts - import html resources

    Newbie question... I can't get the folio to recognize and create two vertical patterns and horizontal in our paper... only the vertical arrangement is recognized.  I use inDesign and have created and modified the other layouts but I can't seem to understand this...

    Is there a more documentation/tutorials on the "import html resources.

    I try to import a javascript/html code that contains educational activities, but the function "insert html" in indesign does not allow me to insert the entire code (it's too big)...

    Thanks in advance

    Looks like you're confusing HTML articles with HTML resources. Resources HTML is primarily a way to share images and assets among various articles. Searching for information on importing HTML articles.

  • JS function as a type of page in QML property

    Hi all

    I'm trying to create useful js 'class' for my blackberry application and save here some information about qml object here is the example of such file js:

    /* * my js */
    
    function Utils(devInfo){ this.devInfo = devInfo; this.text = "test text";
    
     this.getInfo = function(){ return this.text; };}
    

    I want to group some utils functions here and use this js in qml file object, but I don't want to create "Utils" every time, I would like to have a single instance of page qml. I tried to use properties:

    import bb.cascades 1.3
    import com.example.bb10_samples_states 1.0
    import "myscripts.js" as Scripts
    
    Page {
        property variant utils : new Scripts.Utils(deviceInfo)
    
        Container {
            Label {
                id: myLabel
                text: "Hello World"
            }
    
            onTouch: {
                var newLabeltext = utils.getInfo(); // freezing
                myLabel.text = newLabeltext;
            }
        }
    
        attachedObjects: [
            DevInfo{
                id: deviceInfo
            }
        ]
    }
    

    * DevInfo is registered object c ++

    I got the following in the notecard event error message:

    "asset:///main.qml:15: TypeError: result of expression 'utils.getInfo' [[object Object]] is not a function."

    If I do not use the property and only with variable work, everything is ok. The following code works correctly:

    import bb.cascades 1.3
    import com.example.bb10_samples_states 1.0
    import "myscripts.js" as Scripts
    
    Page {
        //property variant utils : new Scripts.Utils(deviceInfo)
    
        Container {
            Label {
                id: myLabel
                text: "Hello World"
            }
    
            onTouch: {
                var utils = new Scripts.Utils(deviceInfo);
    
                var newLabeltext = utils.getInfo();
                myLabel.text = newLabeltext;
            }
        }
    
        attachedObjects: [
            DevInfo{
                id: deviceInfo
            }
        ]
    }
    

    In general, I don't know where I can store object js in qml page to access my functions utils without need to create each time. Any ideas?

    I think I found the answer

    According to this link, there is no global js object and every instance of component QML has own unique copy resources imported from JS:

    ...

    Code-Behind implementation resources

    Most of the JavaScript files imported into a document QML are implementations with State of the QML importation document. In these cases, each instance of the QML object type defined in the document requires a separate copy of the JavaScript and State objects to behave properly.

    The default behavior when importing the JavaScript files must provide a unique and isolated copy for each instance of the QML component. If this JavaScript file any resources or modules with a statement .import, its code will be executed in the same scope as the instance of the QML component and therefore can access and manipulate objects and properties declared in the QML component. Otherwise, it will have its own unique scope, and the objects and properties of the QML component should be passed to the JavaScript file as parameters functions if they are required.

    ...

    http://Qt-project.org/doc/Qt-5/qtqml-JavaScript-resources.html

    So it seems there is no need to implement the model of sigleton or store JS resources in the QML document. I changed my code as follows:

    /**
     * js
     */
    var utils = {
      devInfo : null
    };
    
    function init(deviceInfo){
      utils.devInfo = deviceInfo;
    };
    
    function getText(){
      return utils.devInfo + " done.";
    };
    

    and qml:

    import bb.cascades 1.3
    import com.example.bb10_samples_states 1.0
    
    import "myscripts.js" as Scripts
    
    Page {
        Container {
            Label {
                id: myLabel
                text: "Hello World"
            }
    
            onCreationCompleted: {
                Scripts.init(deviceInfo);
            }
    
            onTouch: {
                myLabel.text = Scripts.getText("Tra-ta-ta");
            }
        }
    
        attachedObjects: [
            DevInfo{
                id: deviceInfo
            }
        ]
    }
    

    It works fine - I can store information in the variable 'utils' and work with qml js objects. Hope so, it will help someone

  • QDateTime in qml?

    Hello

    I was wondering how to import and use the QDateTime object in qml?

    Thank you!

    any reason that you need QDateTime?

    Why not use the javascript date?

    var date = new Date();

    var formattedDate is Qt.formatDateTime (date, "yyyyMMdd");. to set the date

    You cannot store a javascript date object in a qml "establishment variant" but you can simply import a javascript with a variable to store these data in a context QML.

  • I can't find out how to get this script on my site. It is a collection of Locbox email plugin.

    " < script type =" text/javascript"src =" https://app.locbox.com/website_plugins/lb-410fe8a00153ff975ba748d382e1d5aa37edcae1.js "> < / script > .

    When I enter in HTML, I get only a placeholder HTML and nothing else. I'm using Business Catalyst to my host.


    Thanks for any help


    Brad Polt-Jones

    You cannot use import as HTML filter because the file you are importing is javascript.

    You must add code in the Meta data section:

    1. right click on your page

    2. click on page properties

    3. choose the metadata

    4. add javascript in the head section

  • A few questions for the experts

    I have observed the reason why I do not understand:

    1. What is the purpose of the Main () function ?
      • It is simply a wrapper around the original substance?
      • I guess that global definitions must always precede it.
    2. Examples of Adobe (for example SnpCreateDialog) use the form
      • SnpCreateDialog.prototype.run = function() {...}
      • rather than simply the function SnpCreateDialog () {...}
      • What is the logic behind this?
    3. I also found one that some Unicode characters are not allowed in the comments to a script of UTF - 8 encoded. In my long-running script (now > 1000 lines) I need a regular expression in the editor to find the culprit: [^ \p{L}\p{N}\p{P}\s\$\<\> = +------^]

    goRtfDoc.Close... / / must be postponed to preserve the ¶ - ID

    This creates the error

    Error message: character conversion error
    Script, line #: H:\Adobe\framemaker.12en\AdobeFrameMaker12\6, 0

    The ¶ symbol by substituting the word paragraph corrected the error.

    = > is there a list of "unallowed" characters or vice versa, a list of characters (also for string constants?).

    Hi Klaus,

    I'm not an expert, but I can answer a few questions, I think.

    I'm not sure that a main() function is very important in JavaScript, which analyzes and runs to a large extent of procedural way. It is important for the standalone executable program (exe), because when you run a program, the operating system environment or the runtime needs to know where to start. For example, an archive executable Java must have a main() function, because this is the norm for the JRE to know which function/method to run first when the program is launched. If you see it in JavaScript, it could just be there as a general convention question of programmers appreciate general conventions. -WARNING - I don't know for sure that's true.

    I think that global variables may appear anywhere outside the functions in JavaScript, even though I think it is certainly preferable to declare before all the functions that use.

    The prototype company is a technique to add a method to the underlying of the object type, such that all objects of this type can invoke it later. In your example, I suppose that if you do this...

    var kdaubesDialog = new SnpCreateDialog();

    Then, you could do this with your object:

    kdaubesDialog.run ();

    For more information, see JavaScript Prototypes.

    Regarding the problem of unicode, I think there may be some bugs in the application ARE. Also, I came across this problem when some character (or sequence of characters maybe) caused it just freeze. I forgot which character he was, but once I me am rid of him, things has worked. Maybe there's a standard JavaScript to do this, but I'm not aware of it.

    I hope this helps.

    Russ

  • Bland-Out between the pages

    Hello

    How can I fade between the pages?

    I found this on the web:

    <script type="text/javascript">

        $(document).ready(function() {

                $("body").css("display", "none");

                $("body").fadeIn(2000);

        });

    </script>

    I have address can the body element directly onboard or I shouldn't do it directly in the html file?

    Thank you

    s.

    Add code to the event handler from compositionReady to the scene below:

    $("body").fadeOut (0);

    $("body").fadeIn (2000);

    If you are using version Edge animate 20141, then you must import the Javascript to use the features of fadeOut/fadeIn.

    HTH,

    Vivekuma

  • Is it possible to import the same JavaScript document into several PDF documents at the same time

    I have a recurring project where I disable advance click into individual PDF by using a JavaScript document. Is it possible to import this script into several PDF files at once rather than having to manage it at the same time?

    You can create an Action that adds the script. Curiously, the Action would be a JavaScript that uses the doc.addScript () method.

  • WebCenter Capture - how to debug javascript for import processor

    Javascript for import processor code is server-side.  Therefore, it does not println in the java console.

    How to debug a process of import or of javascript recognition process?

    Thank you

    you will use the standard recorder instead of the println function. as you say, that only works for running javascript on the client side.

    See doc-id 1946012.1 for a good example.

    hope this helps,

    -ryan

  • JavaScript server-side: jdbc package import?

    I am using mozilla rhino or the standard java scripting api (javax.script) to access oracle via jdbc from javascript. However, it seems that I can't import the necessary oracle packages:

    importPackage (java.sql);

    importPackage (oracle.jdbc);

    importPackage (oracle.jdbc.pool.OracleDataSource);

    ....

    I run my sample code (code.js) with rhino as here:

    D:\MyDocuments\Docs\Javascript > java - classpath code.js org.mozilla.javascript.tools.shell.Main "D:\oracle\product\12.1.0\dbhome\jdbc\lib\ojdbc7.jar;D:\oracle\product\12.1.0\dbhome\jlib\orai18n.jar;rhino1_7R4\js.jar"

    js: eception JavaScript runtime exception: ReferenceError: 'oracle' is not defined.

    The same error occurs when you use the api java script directly.

    I'm not really a javascript coder, I experience for a specific reason. Any help would be greatly appreciated.

    I discovered, that I don't need to import the oracle packages to make the connection. The following code works.

    importPackage (java.sql);

    Conn = java.sql.DriverManager.getConnection ('jdbc:oracle:thin:@localhost:1521:db1', 'user', 'password');

    stmt = conn.createStatement ();

    RSet = stmt.executeQuery ("SELECT * FROM dual");

    While (rset.next ())

    {

    Print (RSet.GetString (1));

    }

    RSet.Close ();

    stmt. Close();

    Conn.Close ();

  • JavaScript for XML Export &amp; Import XML button button

    Hello:

    I'm a Newb Javascript and I think that I little bit bigger than I can chew... I am trying to create a series of forms (15) and I would like a Data Export and Import button so that the schematic form information could easily be exported and imported into eachother. I was wondering what would be the code required to program a shape data export button and button import data in a form.

    Once an employee submits the form, the submit button will turn into a button "Export form data" where management can click it and it will export the data from the form in XML format to a local folder (download folder?). "The Manager can then choose the appropriate form, open the blank form, click the"Import form data"button of this form where it will be important the ' form_data. XML"file from the folder download and continues to fill the rest of the information. Now, the loop is complete between the forms.

    It is one of the last things I'm finishing on this gigantic project, any help is greately appreciated!

    Thank you

    Hello

    I think that exportXFAData is not supported in the designer. I think you need to use:

    xfa.host.exportData

    http://help.Adobe.com/en_US/LiveCycle/9.0/designerHelp/001341.html

    Stephen

Maybe you are looking for