简体   繁体   中英

sending parameters to java app using javascript

I use a 3rd party website where a java app is loaded and booted up by my browser with javascript (see code below).

Is there any way I can use different javascript to send/change parameters values sent to this app without doing a full reboot of the app?

Note I can use a browser add on to add extra javascript to the web page

Specifically I want to quickly change the parameter feedSymbol : "L%5EFLOW" once the app has been loaded up and is running without rebooting.

<script>
$(document).ready(function()
{
    var bootConfiguration = {
        appName : "level2",
        advfnURL : "http://uk.advfn.com",
        rpcURL : "//rpc.advfn.com",
        streamerURL : "wss://streamws.advfn.com",
        alternativeStreamerUrl : "ws://streamws.advfn.com:7000",
        alternativeStreamerUrlFallback : "ws://streamws.advfn.com:80",
        newsSources : "ukreg,eqsreg,nnw,nmw,ihcn,rnsnon,prnca,prnus,zacks,etfdb,money,money2,djn,bw,globe,globereg,otcds,jcnen,wilink_us,wilink,dfx,afa,edgar,mktw,mwus,awus,ppty,rttf1,rttf2,alnc,reut,one,ihnw,advnw,etel,seek,tmf,fsc,arn,paperau,currenciesdirect,newsbtc,cryptominingblog,cointelegraph,coindesk",
        locale : "en_GB",
        site : "uk",
        timezone : "GB-Eire",
        timezoneOffset : "0",
        indices : "[{\"feed_symbol\":\"FT^UKX\",\"name\":\"FTSE 100\"},{\"feed_symbol\":\"FT^MCX\",\"name\":\"FTSE 250\"},{\"feed_symbol\":\"FT^ASX\",\"name\":\"FTSE All-share\"},{\"feed_symbol\":\"FT^T1X\",\"name\":\"FTSE Techmark\"},{\"feed_symbol\":\"DJI^I\\\\DJI\",\"name\":\"Dow Jones\"},{\"feed_symbol\":\"NI^I\\\\COMP\",\"name\":\"NASDAQ\"},{\"feed_symbol\":\"NIK^N225\",\"name\":\"Nikkei\"}]",
        colorSchema : {"up":"#000090","down":"#CF0000","unchanged":"#008000"},
        changeArrows : {"up":"blue_up.png","no_change":"green_dot.png","down":"red_down.png"},
        displaySymbol : "LSE%3AFLOW",
        feedSymbol : "L%5EFLOW",
        supportEmail : "support@advfn.com",
        supportPhone : "+44 (0) 207 0700 961",
        monitorId : "",
        fixedMonitor: "0",
        monitorSettings : {"indexBreakUp":true,"orderSymbols":true,"defaultDisplay":"1"}
    };

    var s = new Session("username","password", bootConfiguration);
    Env.setSession(s);
    s.start();
});
</script>

Other code I noticed in the page source which may or may not be relevant

<script>
    var el = $('#SymbolTitle').parent();
    el.onSymbolChange = function(symbolObj)
    {
        elementUpdateParam(this, 'symbol', symbolObj.feed_symbol);
        elementUpdateParam(this, 'special_title', symbolObj.titles);
        elementTriggerLoad(this);
    };
    ADVFNSymbolInfo.addListener(el);
    </script>

It completely depends on how the Java application has been written. Once we know the API it publishes and the parameters it expects, it's trivial to write the corresponding JavaScript client.

So, do you have access to the application API and/or documentation?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM