Calling .jsx functions from .js files using HTML Widget

Hi there,
I'm using the HTML Widget in a panel to load an html file along with some javascript files. Is there a way to call .jsx Adobe functions from a .js file? I've successfully been able to call an alert() of a .jsx file from the html but have not been able to do anything further than that.
For example:
.js file:
var x = foo('bar');
alert(x);
.jsx file:
function foo(x) {
    alert('This works');
    var dir = $.fileName;
    alert('This doesn't work because of $.fileName');
    return 'Directory: ' + dir;}
So, ultimately I would like to have an HTML Widget in my panel, press a link that will call fiddle with the open document and layer, then return some values back to the HTML Widget's js file.
Thanks

To the client browser, JSP is just HTML. Adding JS makes it DHTML, which provides the kind of applet/web page interaction you were referring to in the first post. Note that the applet and JS are both being run 'client side', whereas the JSP is generated 'server side'.
A JSP environment can in some cases replace the JS (e.g. submit a form with values to the server, and use JSP to write the resulting applet page). This can be handy in the event that the end user does not have JS enabled, in that you can offer a 'pure HTML' solution. OTOH though, it is slower (requires a round trip to the server to do what the user asked for) and most users prefer the quicker 'click and see' philosophy of the Java/JS combo.
So, my advice to you is that JSP adds very little value, here.

Similar Messages

  • Calling javascript function from *.js file in Acrobat plug-in

    Hello,
    I had already found that 'AFExecuteThisScript' procedure but ity seems that it execute a script passed in param as a string. What about if I want to execute an external '.js' file ?
    Are there any other function that can do that? What about parsing whole *.js file as a string?
    Do you have any idea or code exaple how to do it?
    Hope this is possible.
    Thanks in advance for your reply.
    Grzegorz

    I have read it, and still don't know how to do that.
    I need to put my config.js script in "app" folder-level - the plugin should be available for all users.
    I have code:
    ACCB1 ASBool ACCB2 PluginInit(void)
        char * jsscript = "config.js";
        AFExecuteThisScript( NULL, jsscript, NULL);
        return true;
    my question is "how to run code from this file, what should variable jsscript contain?? how can I run single functions from this file?
    Another question is:
    is it possible to automaticaly run *.js file from "app" folder-level like it is going from "user" folder-level. I need to create plugin for all users, can't put *.js file for all users in their own folder
    Thanks for the answers.
    Gregory

  • How do I call a function from another file?

    In MainView.m I have one function -(void)goTell;
    I want to be able to call the function from SecondView.m. How do I do this?
    I have declared the function in the MainView.h and added #include MainView.h to SecondView.m, but it still doesn't work.
    This code crashes my program (for some reason this board takes away my brackets... assume the code is written correctly):
    [[MainView alloc] init];
    MainView *myMainView;
    [myMainView goTell];
    By the way... goTell has nothing in it. It's just a blank function for testing purposes.
    Ethan

    BTW - Wrap your code like this in posts tags so it stay readable.
    put code here
    Your code needs to be:
    MainView *myMainView = [[MainView alloc] init];
    [MyMainView goTell];

  • Calling cvi functions from test stand using structs

    WE got some Issue regarding the process of calling cvi function using test stand

    I'm sorry to hear that you have some issues calling cvi functions. There is a shipping example that demonstrates how to call a CVI function and pass a structure. The example can be found in <TestStand>\Examples\StructPassing\C\Struct Passing to a C DLL.seq.
    If the example program does not resolve your issues, post again and please describe the problem in detail.
    Regards,
    Shannon R.
    Applications Engineer
    National Instruments

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • How to call C function in .m file from another function in a .mm file

    I am making an interface class between a C library and an objetive C application.
    I have not problem calling function the C library from .mm funstions,
    but I am having problems calling .m functions from the .mm class.
    here is an example of what I mean.
    here in my .m vector file
    *struct dVector*
    * float m_x;*
    * float m_y;*
    * float m_z;*
    * float m_w;*
    *struct dVector InitVector (float x, float y, float z, float w);*
    *struct dVector AddVector (struct dVector* A, struct dVector* B);*
    *struct dVector SubVector (struct dVector* A, struct dVector* B);*
    here is my .mm class
    *#import <Foundation/Foundation.h>*
    *@interface iNewton : NSObject*
    * void* m_world;*
    *-(id) init;*
    *-(void) dealloc;*
    -(void) CreateBox: (Entity*) ent: (int) shapeId;*
    @end
    here is the implemrntation of function funtion CreateBox in a .mm file
    [code]-(void*) CreateBox: (Entity*) ent: (int) shapeId
    struct dVector minBox;
    struct dVector maxBox;
    // this is fine
    [ent GetBBox: &minBox: &maxBox];
    //calculate the box size and dimensions of the physics collision shape
    // this report a link errors, and I do no knwo why
    struct dVector size = SubVector(&maxBox, &minBox);
    struct dVector origin = AddVector (&maxBox, &minBox);
    // thsi work without problemen
    return NewtonCreateBox ((NewtonWorld*) world, size.m_x, size.m_y, size.m_z, shapeId, &offset.mfront.mx);
    I get these compiler errors
    Building target “tutorial102AddingRigidBody” of project “newton_iPhone” with configuration “Debug_Emulation” — (3 errors)
    cd /Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newton_iPhone
    setenv MACOSXDEPLOYMENTTARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2 .1.sdk -L/Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/DebugEmulation-iphonesimulator -L/Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newton_iPhone/../sdk -F/Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/DebugEmulation-iphonesimulator -filelist /Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/Debug_Emulation-iphonesimulator/tutorial_102_AddingRigidBody.build/ Objects-normal/i386/tutorial_102AddingRigidBodies.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework CoreGraphics -lnewton_iPhoneEmulation -o /Users/juliojerez/Desktop/NewtonMac/NewtonSDK/newtoniPhone/build/Debug_Emulation-iphonesimulator/tutorial_102_AddingRigidBodies.app/ tutorial_102AddingRigidBodies
    Undefined symbols:
    "AddVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "SubVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "Scale(dVector*, float)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    "AddVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "SubVector(dVector*, dVector*)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    "Scale(dVector*, float)", referenced from:
    -[iNewton CreateBox::] in iNewton.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    Build failed (3 errors)
    Basically I can call objective C class methods from .mm files,
    but I can not call functions who are not members of a class from .mm funtions.
    Does any one knows how I can solve this?
    I have two books on objective C and neither show how to do that.
    Please I will apreciate if some one can help me with this.
    Julio Jerez

    julio jerez wrote:
    // this is fine
    [ent GetBBox: &minBox: &maxBox];
    why will tha be wrong?
    ent is a objective C class with a method GetBBox
    wich I use in hundred of places with out problem.
    Beside that is not the problem that.
    Well, you've got me on this one. You are correct. Apparently you don't need to specify the parameter names. Still, I strongly encourage you to use parameter names. Even though they apparently aren't required, I've never seen them not used. I would have expected to see:
    [ent GetBBoxMin: & minBox max: & maxBox]
    The problem is calling C function that are declared in .m files.
    if you read the errors, they are linking errors not compiler errors.
    this is a C function that is declared in a .m file
    struct dVector size = SubVector(&maxBox, &minBox);
    beside I also use those functions in many other place as well in teh project and they work.
    If it helps I can post a link to the a download place to the xcode project maybe it is eassy to see what I am trying to do.
    That would probably be a good idea.
    Normally, all you need is
    extern "C"
    but there is so much missing from what you've posted that I can't tell for sure what is going on.

  • Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?

    My vendor has sent me a .sys file with functions accessing their hardware.  Can i call these function from labview directly or do I have to wrapper the .sys with a dll?

    Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
    However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
    Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can Any one tell me what is the step in calling a function from a *.lib file in Labview application

    Hi, I am working on Labview 8.0.
    I am trying to  communicate to a thrid party HW using the driver file he has provided to me.
    The drive file is a *.lib file.
    I am unable to call the function from the lib file.
    I could get only from a DLL.
    Pls help .
    Regards
    -Patil

    patil wrote:
    When it is possible in Lab Windows, why calling a function from a static library is prohibited?
    I was trying to use Function node, but found that it is only for functions from a DLL file.
    Will CIN be useful.? 
    LabWindows is not the same as LabVIEW. LabVIEW cannot call .lib files. LIB files are intermediary products and you need to use a wrapper DLL that's compatible with the object format of the .lib file. It's as simple as that. LabWindows creates C application and from that perspective is no different than a regular C
    compiler. That's why you can call .lib files because that's how .lib
    files are used.
    A CIN, as pointed out, is something completely different and will not help you.  

  • Calling a function from a dll written by using visual studio c++

    Hi, how can i call a function from a dll which is written by visual studio c++ in test stand?  Although the functions in dll are exported and i've chosen c/c++ adapter, i saw no function in test stand. Is there a different step while i'm calling a function from a dll written by c++ than calling a function from a dll written by cvi?

    Hey Sadik,
    Selecting the C/C++ DLL Adapter Module should be sufficient for this. When you drag an action step for this onto the Main Step and navigate to the location of the DLL, the function list should populate and you should be able to select the function you want to use. If this is not the case, would you be able to post this DLL so that we can test this on our end?
    Regards,
    Jackie
    DAQ Product Marketing Engineer
    National Instruments

  • How to convert from xml file to html using java code

    How to convert from xml file to html file using java code

    Get yourself Apache Xalan or Saxon or some XSLT processor
    String styleSheet = "/YourXSLTStylesheet.xsl";
    String dataSource = "/YourXMLDocument.xml";
    InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
    InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
    OutputStream transformedOut = new FileOutputStream("filename.html");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
    transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
    http://www.w3schools.com/xsl/

  • Calling c function from java!!

    hi all,
    I want to call c function from java . I have gone through the link http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html for JNI.
    According to this link we need to write the native method implementation in such a way that the method signature should exactly match the method signature created in the header file.
    My problem is that i have a c application which i cannot modify in any ways i.e., i cannot change its code. But i want to call its function from my java code.
    Please suggest me appropriate solution for this. Please let me know whether it can be done using JNI or is there any other method for this.
    thanks

    This link is amazing since those sources were wrote in 1998 and I started to develop JNative in 2004. I did not found them when I started.
    Since JNative can deal with callbacks and probably COM in a near future, I expect to see it living to Dolphin at least.
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Calling javascript functions from xsl on mac safari

    Hi,
    I am having a problem calling external javascript functions from xsl on mac safari, i am trying to generate a dropdown dynamically from an xsl document using XSLTProcessor through javascript, following is the code snippet of the xsl document
    <select name="ddl_EmailSubType" class="Menu" onclick="onEmailSubTypeChange();" id="ddl_EmailSubType" >
    <xsl:for-each select="./SubTypeFields/FieldGroup">
    <xsl:if test="@SubTypeGroup != 'All'">
    <option>
    <xsl:attribute name="value">
    <xsl:value-of select="@SubTypeGroup"/>
    </xsl:attribute>
    <xsl:if test="@SubTypeGroup = $SelectedSubContentType">
    <xsl:attribute name="selected">selected</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="@SubTypeGroup"/>
    </option>
    </xsl:if>
    </xsl:for-each>
    </select>
    here the function onEmailSubTypeChange() is present in an external js file, all the other functions from this files are executed successfully except the ones which are defined in the xsl document.
    I have also tried replacing onclick="onEmailSubTypeChange();" with onclick="javascript:alert('hello world');" but the event is not getting fired at all since i cannot see any alert on the selected item change of the dropdown.
    Is there a way in which i can achieve this ?
    any helps appreciated.
    Thanks in advance
    Vikas Mestry.

    Hi,
    you can use this example VI
    Regards,
    Aurélien J.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Du 30 juin au 25 août, embarquez pour 2 mois de vidéo-t'chat ! Prenez place pour un voyage au coe...
    Attachments:
    browser gps.vi ‏23 KB

  • How do I call Vee functions from TestStand ?

    I wish to call Vee functions from TestStand steps.
    I am using Vee 6.01 and TestStand 2.0.

    Hi Gerry,
    Sorry about that. Below is a sequence file created in 2.0.1f1. Please copy the contents of the zip file (previous attachment) into the folder \Examples\VEE\Using ActiveX (VEE 6.0). Please create this directory if it does not exist. The next thing you will need to do, is register the TestStand VEE server located in \Examples\VEE\Using ActiveX (VEE 6.0)\VEE_StepType.dll. To do this:
    1) Select Start>>Run.
    2) Type regsvr32 "C:\TestStand\Examples\VEE\Using ActiveX (VEE 6.0)\VEE_StepType.dll"
    You should get a message saying that the registration was successful. You should now be able to run the example. Please let me know if you encounter any further problems. Thanks!
    Attachments:
    Computer.seq ‏66 KB

  • How can we call actionscript functions from js

    hi
    how can we call Action script function from js file . i
    tried ExternalInterface. add Callback() .but it throws an error .is
    there any other chance to call action script method .thnx in
    advance

    angadala,
    some people have found it is good to include the full
    qualification path, ie
    if (flash.external.ExternalInterface.available)
    flash.external.ExternalInterface.addCallback("ext_method_name",int_method_name);
    } // if (flash.external.ExternalInterface.available)
    There are also browser differences which affect how you find
    the Flex application object which are documented at
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=passingarguments_5.html
    Richard

  • Call JavaScript function from Acrobat Plugin

    Hi All,
    I want to call JavaScript function from Acrobat Plugin? Where is to write JavaScript function in Acrobat SDK? Please reply..
    Thanks in advance..

    Hi Malkyt,
    Thanks.. where is to write JavaScript code in the application..
    function GetWelcome()
    alert("Welcome");
    this above code. how to use this javascript code to plugin application.
    static ACCB1 ASBool ACCB2 AVPageViewMouseClick (AVPageView pageView, AVDevCoord xhit, AVDevCoord yhit, AVFlagBits16 flags, AVTCount clickNo, void *data)
    char jsscript[200];
    AFExecuteThisScript (pddoc, jsscript, NULL);
    i want to display welcome message of JS file.. give me step to perform above task.. Please reply...

Maybe you are looking for

  • Adding a link to a table cell question

    ho can i add a link into a cell containing an image without increasing its size? I am trying to make a link out of a table cell containing an image. the problem is that the highlight frame around the image increases the size of the cell (and i cant h

  • Acrobat X page shows small page image at top right of screen. Need to remove

    Acrobat X on Windows 8.1.  Recently Acrobat has started showing a small representation of the current page at the top right of the screen. I don't need this and would like to kill it permanently in all files. For example apart from blocking some text

  • Hi Sirs Need One Big Help With 8520

    Hi Have Some 8520 Hang In Logo .Have Wipe And Update By App Loader But Same Problem .Have  Clear Board With Thinner But  Same Problem .Have Write Firm 4.6 But After This Only On Led Red Any One Have Solution ???? Here Picture = http://i52.tinypic.com

  • Can see my file in Windows explorer but not in DW

    There's gotta be an easy fix for this one...  I have a .jpg that I copied over into the file structure of my local site.  I know it's there, I can open it from Windows explorer.  But DW doesn't see it!  I tried just closing and relaunching DW and reb

  • Restricted stock used in intra-company stock transfer

    Hi, Can anyone give me the link about the description and difference between unrestricted stock, restricted stock and blocked stock? And for intra-company stock transfer(in one company code), I would like to post goods issue with restriced stock. and