Prevent function access between 2 scripts

Hello,
I have a understanding problem with InDesign JavaScript Engine.
I have two simple Scripts.
Script 1:
alert(random(100));
function random (max) {
    return Math.floor (Math.random() * max);
Script 2:
alert(random(100));
If I execute the Script 1 it is works fine.
If I execute the Script 2, it finds the function "random" from the Script 1.
How I can prevent this ?
I have tested #targetengine, #engine and #script.
mfg
mpd323

If you execute Script1, then Script2, in the same persistent engine, the function random that you declare in Script1 is available in Script2.
What's the problem?
Do you need to use a different random function in Script2?
You may add a #targetengine 'Script1' directive in Script1, and a #targetengine 'Script2' directive in Script2, to separate each process. (In this case, random need to be defined in Script2).
If you use the same #targetengine, you can ‘overwrite’ random in Script2 by using something like:
this.random = function() {/*Script2 random stuff*/}
but that's probably not what you want...
Finally, what don't you use random1 in Script1 and random2 in Script2?
If you really need two distinct functions, create two distinct functions!

Similar Messages

  • Key functional differences between SRM 7 and SRM 5

    Dear All,
    I urgently need to put togther a comparison document thst list key functional differences between SRM 7 and SRM 5.
    NB. i donot have access to service marketplace.
    sheena.roberts(AT)yahoo
    Thanks
    Edited by: Sheena Roberts on Jan 18, 2011 11:21 AM

    Hi Sheena,
                        Go to  difference between srm 5.0 and 7.0
    Regards
    Vishal Pd

  • Restricting access between the hours of 9am and 5pm

    i need help in creating policy to restrict access between office hours. i have created the function,
    but don't know how to link this up with my database. below is the function i created
    create or replace function office_hrs_only
    (p_schema IN VARCHAR2 DEFAULT NULL,
    p_object IN VARCHAR2 DEFAULT NULL)
    return VARCHAR2
    AS
    BEGIN
    RETURN 'to_char(sysdate,''HH24'') between 9 and 17';
    END;
    regards,
    christina

    Hi, Christina,
    christylong wrote:
    i need help in creating policy to restrict access between office hours. i have created the function,
    but don't know how to link this up with my database. below is the function i createdAre you trying to implement a row-level security policy? If so, you need to call dbms_rls.add_policy, as shown in the Packages and Types manual:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_rls.htm#i1000830
    create or replace function office_hrs_only
    (p_schema IN VARCHAR2 DEFAULT NULL,
    p_object IN VARCHAR2 DEFAULT NULL)
    return VARCHAR2
    AS
    BEGIN
    RETURN 'to_char(sysdate,''HH24'') between 9 and 17';
    END;Remember, TO_CHAR returns a string, so you should compare it other strings, not numbers. Try this:
    RETURN  'to_char(sysdate,''HH24'') between ''09'' and ''16''';If you make the upper limit '16', then people will be able to use the table as late as 16:59:59, that is, one second before 5:00 PM.
    That's not completely intuitive, is it? Maybe it would be better if you said:
    RETURN  'to_char(sysdate,''HH24:MI:SS'') between ''09:00:00'' and ''17:00:00''';Edited by: Frank Kulash on Aug 21, 2011 12:11 AM

  • When clicking websites my Avast 5.0 antivirus notifies me that a malicious URL is trying to access my system or that a Trojan has been prevented from access. The attempted Malware/Trojan is always from the same address:[Ticon.in/nte/kuz/.exe/xhdoe515bvo3

    suspicious Maleware / Trojan.
    == This happened ==
    Every time Firefox opened
    == I tried to access a website

    Hello "Morbus",
    Thank you for your quick and informative reply. First I would like to provide more information on this attempted Malware/Trojan. I have copied the full addresses for you and/or anyone who may have interest. It follows below.
    28.06.2010 07:38:00 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\program files\Mozilla Firefox\Firefox.exe ( 5436 ) ]
    28.06.2010 08:14:44 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 4476 ) ]
    28.06.2010 13:32:53 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 1988 ) ]
    28.06.2010 17:51:53 Network Shield: blocked access to malicious site 楴祣湯椮⽮瑮⽥畫⹺硥e [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 5400 ) ]
    29.06.2010 13:31:03 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 2444 ) ]
    29.06.2010 23:15:14 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 480 ) ]
    30.06.2010 09:36:22 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe/wHd0e51a5bV03006f36002Ra38dbe4f108T9ccfa9f8Q000002fe901801F0035010aJ14000601L656e2d55530000000000 [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 5164 ) ]
    30.06.2010 22:31:52 Network Shield: blocked access to malicious site ticyon.in/nte/kuz.exe/wHd0e51a5bV03006f36002Ra38dbe4f108T9ccfa9f8Q000002fe901801F0035010aJ14000601L656e2d55530000000000 [ C:\Program Files\Mozilla Firefox\Firefox.exe ( 3600 ) ]
    I had failed to mention in my previous comments that each time the attempted attacks took place, a blank Adobe PDF page appeared. As you suggested, I disabled the Adobe add-on and have had no further attacks. I am extremely dilligent in keeping my SuperAntiSpyware Pro, AvastAntiVirus 5.0, ThreatFire, Vista Firewall Control, Malewarebytes and Windows Defender up to date. However, after any attack I always run these in safe mode just as a precaution. I had suspected the Adobe drop-in may have been the culprit because of the page that appeared and your suggested fix has in fact fixed it!
    Thank you again for your unselfish time in coming to my rescue. "Deaf Dave"
    From: [email protected]
    Date: 7/1/2010 12:53:40 PM
    To: [email protected]
    Subject: Reply notification: when clicking websites my Avast 5.0 antivirus notifies me that a malicious URL is trying to access my system or that a Trojan has been prevented from access. The attempted Malware/Trojan is always from the same address:[ticon.in/nte/kuz/.exe/xhdoe515bvo38d
    "Morbus" has posted a reply to a thread you're watching.
    You can view the thread and reply at the following URL:
    https://support.mozilla.com/en-US/forum/1/714170#threadId714337
    Message:
    Hello Deaf Dave.
    It's possible that you are having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal?
    Whenever you have a problem with Firefox, whatever it is, you should make sure it's not caused by one (or more than one) of your installed add-ons, be it an extension, a theme or a plugin. To do that easily and cleanly, run Firefox in [http://support.mozilla.com/en-US/kb/Safe+Mode safe mode] (don't forget to select ''Disable all add-ons'' when you start safe mode). If the problem disappears, you know it's from an add-on. Disable them all in normal mode, and enable them one at a time until you find the source of the problem. See [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes this article] for information about troubleshooting extensions and theme and [https://support.mozilla.com/en-US/kb/Troubleshooting+plugins this one] for plugins.
    If you need support for one of your add-ons, you'll have to contact its author.
    Also, it's possible that your system is infected with malware. To scan for malware, install, update and run these programs ''in this order''. They are all free for personal use, but some have limited functionality in their "free mode", but the features you'll miss are not really needed to find and remove the problem you have. Remember that ''not all programs detect the same malware''!
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php malwarebytes.org/mbam.php]
    SuperAntispyware - [http://www.superantispyware.com/ superantispyware.com]
    AdAware - [http://www.lavasoftusa.com/software/adaware/ lavasoftusa.com/software/adaware]
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html safer-networking.org/en/index.html]
    Windows Defender - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx microsoft.com/windows/products/winfamily/defender/default.mspx]
    Dr. Web Cureit - [http://www.freedrweb.com/cureit/ freedrweb.com/cureit]
    If these don't find it or can't clear it, please tell me and I'll provide you with further assistance.
    Did this response solve your problem with Firefox?
    Yes, this solved my problem (click here):
    https://support.mozilla.com/tiki-feedback.php?id=714170&hash=6d5f163b3092b464aa15d04188b5cca2&type=forum_topic&feedback=Firefox%20Support%20Forum&commentId=714337
    No, this did not solve my problem (click here):
    https://support.mozilla.com/en-US/forum/1/714170?hash=6d5f163b3092b464aa15d04188b5cca2#form
    If you no longer wish to receive notifications for this thread,
    visit the following URL to cancel your subscription:
    https://support.mozilla.com/tiki-cancel_watch.php?section=forum&hash=6d5f163b3092b464aa15d04188b5cca2

  • Trying to access the java script files via jar file in WEB SERVER

    hi all,
    I am trying to access the java script files via jar file ,which is present in Apache webserver in order to minimise the number of hits to app server.some thing like cache ...
    in jsp the code goes like this...
         <script type="text/javascript"  archive="http://localhost:14000/dojo.jar!" src="dojo.jar/parser.js" " ></script>{code}
    But i am not able to access the js file which is put in jar file present in the  webserver.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    You can use DWR (Direct Web remoting) for that. It is easy AJAX for java. ou can directly call the java script function from java class and also java class from javaScripts..
    Regards,
    Hardik

  • Avoid procedure or function calls between a SQL operation and an implicit cursor test

    when i analyse this code with code expert

    atpidgeon wrote:
    when i analyse this code with code expert
                            UPDATE P_PM_CONTROL_COUNT
                            SET AVAIL_SEG = AVAIL_SEG -1,
                                ALLOCATION = ALLOCATION -1
                            WHERE PM_UNIT_TYPE_ID = vrectab(1)
                            AND USAGE_DATE = vrectab(2)
                            AND SEGMENT_CODE = vrectab(5)
                            AND ALLOCATION - UNITS_RESERVED > 0;
                            IF sql%rowcount = 0 then --Added block and exception to prevent invetory going negative when placing multi units in same unit type out of service.
                                vErrMsg := 'Could not process your out of service request because your selection for unit '|| vrectab(3) || ' at ' || pvPropertyId || ' for ' || vrectab(2) || ' would cause segment ' || vrectab(5) || ' to be over allocated.';
                                RAISE SegOverAllocated;
                            END IF;
    i get "Avoid procedure or function calls between a SQL operation and an implicit cursor test.",as far has i know
    iff you're doing a sql%rowcount    after an update.. trying to see how many rows were updated...  you dont want procedure or function calls between the update and the sql% line
    correct me if im wrong and how would i fix it?or maybe i shouldnt
    You correct it by NOT executing function calls as part of the UPDATE statement.
    1. Issue the function calls BEFORE the update statement
    2. save the function results into variables
    3. use those variables in the UPDATE statement.
    v_rectab1 := vrectab(1);
    v_rectab2 := vrectab(21);
    v_rectab5 := vrectab(5);
    UPDATE P_PM_CONTROL_COUNT 
                            SET AVAIL_SEG = AVAIL_SEG -1,
                                ALLOCATION = ALLOCATION -1
                            WHERE PM_UNIT_TYPE_ID = v_rectab1
                            AND USAGE_DATE = v_rectab2
                            AND SEGMENT_CODE = v_rectab5
                            AND ALLOCATION - UNITS_RESERVED > 0;

  • Reference functions inside un untitled script object

    Hello,
    Does someone knows how to reference a function inside an untitled script object?
    thank you

    xfa.resolveNode("#script").functionName()
    You should always name your scriptObjects ...it makes accessing them much easier.
    Paul

  • How to prevent the access of more than one person to an APEX application?

    Hello,
    I want to prevent the access to an application when it is already opened by another user.
    How to do it?
    Thank you by advance
    Jean-Louis

    Why would you want to do this? APEX applications are MEANT to be MULTI-USER WEB BASED APPLICATIONS? This makes NO SENSE..
    If you need this functionality, you can do this in Access..
    Thank you,
    Tony Miller
    Webster, TX

  • Override:A class is prevented from accessing mehods in is immeditae ancesto

    Can we said about override this way:
    A class is prevented from accessing mehods in is immeditae ancestor?
    can some problem:
    1: can private method be overrided?
    2: can static method be overrided?
    3: can method be overrided as static?
    Thanks!

    Here you can see a clear difference between a) overriding a method in a subclass and b) defining two static methods, when placed in constructors.
    public class C{
    public static void main(String[] args){
         B b = new B();
    class A{
      A(){
         mm();  //call a non-static method in the constructor
          void mm(){
              System.out.println("A");
    class B extends A{
      B(){
         mm();
          void mm(){
              System.out.println("B");
    }and this.
    public class C{
    public static void main(String[] args){
         B b = new B();
    class A{
      A(){
         mm();//call a static method of A in the constructor
         static void mm(){
              System.out.println("A");
    class B extends A{
      B(){
         mm();
         static void mm(){
              System.out.println("B");
    }

  • Whats the functional difference between user IDs SAP* and DDIC?

    Whats the functional difference between SAP* and DDIC? Can any one tell me please. I am new here. Thanks in advance.

    Hi Farooq,
    There are three user IDs in various SAP clients.
    1. SAP* (Client 000 and 001)
    SAP* denotes the default super user and has all administrative powers.
    2. DDIC (Client 000 and 001)
    DDIC user is responsible for the maintenance of the ABAP/4 Dictionary and the software logistics.
    3. EarlyWatch (Client 066)
    The EarlyWatch user has access only to monitoring and performance data.
    Please check this link for more information on data dictionary objects.
    http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ea31446011d189700000e8322d00/content.htm
    Hope this will help.
    Regards,
    Ferry Lianto

  • Functional difference between Blackberry and Internet Browser on the device

    Hello:
    Based on the following link, I understand the difference between the Blackberry and Internet browser (http://www.blackberryforums.com.au/forums/blackber​ry-general-discussion/2815-difference-between-brow​...
    I was wondering if there are any functional difference between the two, i.e. HTML rendering, images being broken, etc. Under Browser -> Options -> Browser Configuration, If I configure both the Blackberry and Internet browser the same way, will a particular URL behave the same?
    I'm in the process of testing our mobile applications on different devices and would appreciate if you could provide the difference, if any between the 2 browsers.
    Thanks:
    Vishal

    Hey vishalt77,
    Welcome to the BlackBerry Support Community Forums.
    All BlackBerry smartphones will have Internet Browser for browsing the web.
    However if you're on a BlackBerry Enterprise Server, you get the BlackBerry Browser which enables you to access internal websites and secured websites.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • How to access a JAVA Script variable in JSP Code

    How to access a JAVA Script variable in JSP Code. I have been unable todo this.
    Plz Suggest a way.
    Thanks
    Soumya

    try to do this code
    String s=request.getParameter("javascriptvariablename");

  • What are the functional differences between the iPhone and the iPod Touch, barring of course the differences in service requirements.

    What are the functional differences between the iPhone and the iPod Touch, barring of course the differences in service requirements.

    For one, their form factors are slightly different as the iPhone has a bit more squarish body whereas the iPod Touch has a tapered back to it. 
    The iPhone also has much better front and rear cameras. Exact details as to the difference in megapixels depends on whether or not you talking about the iPhone 4 or 4S.  If you would like to get more details, you can always view
    each models specs on Apple's online store.
    See here for a better explanation.
    http://en.wikipedia.org/wiki/IPod_Touch#Comparison_to_the_iPhone
    I'm sure others will chime in with other things as well.
    B-rock

  • Interface/Functional Differences between EPM Planning 11.1.1.3 & 11.1.2.2.

    We are considering a migration from Hyperion Planning 11.1.1.3 to 11.1.2.2 and have found lots of documentation describing the technical exercise but little on the functional differences between the two products that would be of more interest to our users.
    Q1. Will 11.1.2.2 appear to our users as fundamentally a different product requiring retraining, changes to business procedures etc?
    Q2. Is there any documentation out there that compares the functionality and 'look' of the two releases that I have missed and that would help?
    Thanks.

    You could have a look at the cumulative feature tool which highlights functionality additions between versions by product - https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=1092114.1
    It is probably worth setting up a quick 11.1.2.3 POC planning instance to have a look at the new version of planning to see whether you feel that additional training will be required - http://docs.oracle.com/cd/E17236_01/epm.1112/epm_planning_rapid_deploy_1112200.pdf, the main change is the look and feel with the ADF functionality the concept of planning has not changed, the ADF functionality can be switched off if you want to revert back to the old style.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • An error prevents the Change Management Upgrade script from executing

    I have Warehouse Builder 10g on a database 10g R1.
    On a server linux I have the repository, and on other server (Sun 5.9) I have runtimes for production.
    I want execute an upgrade deploy action on one object but I get this error:
    An error prevents the Change Management Upgrade script from executing successfully. We strongly advise that this Upgrade is UNDONE and the problem is investigated. Data loss may occur if you accept this Upgrade
    Any idea?
    Thanks,
    Fernando.

    I review the installation, it was made with a diferent user that database, I get same permission, restart runtimes service and problem was resolved.
    Fernando.

Maybe you are looking for

  • 10 Minutes to reboot Lion Server 10.7.3 !

    Mac Mini, 10.7.3 Server Hello, I am at the end of my tether.... I did a clean install of 10.7.3 Server, I used Migration Manager to copy back apps and user home directories from an external FW drive. Few problems with the server so far, but when I re

  • How can I embed webpages in a simple screen presentation (.pdf vs . folio)

    Hello folks! I'm a big indesign user and I'm a kind of pdf fan for a long time but I'm having some troubles right now! Well, I need to publish a simple presentation for a conference. So far I'd like to embed some webpages into my presentation and I c

  • Newbie extract help needed

    Hi all, I have a full Photoshop webpage layout file with several layers – and I need to extract parts of it to use on the website. I do know a little bit about slices – but I would prefer to not use that now. Rather I was thinking of saving a tiff fi

  • LDAP Password rules in Portal

    Hello Friends,   I have a requirement that if the password is expired in LDAP, portal login should give change password screen instead of generic error message. Is there any way to do this other than implementing a custom login module. Has anyone tri

  • Whats the solution to this "avconvert failed to create an export session"

    I try to convert some mpg clips from my camera so i can use in imovies and i get this ...avconvert failed to create an export session. Anyone knows how to fix this?