I wold like to know how to call a JavaScript function from ActionScript 1 and get the result.
Thanks.
I haven't used AS1 for years but I used the old FSCommand in the past.
See a very detailed tutorial here:
http://www.moock.org/webdesign/flash/fscommand/
which is similar to http://forums.adobe.com/message/2701630
Another alternative here:
http://www.actionscript.org/forums/showthread.php3?t=8332
Thanks and good luck! :)
Related
I want to call my javascript function from my Cocos2d-X cpp file and want to pass data from cpp class to javascript file.
I tried and google it, but the solution i found was old and not found in current version of Cocos2dx/ Cocos creator. If anyone knows what the solution is, please help me, thanks very very much!
Already tried this how to call javascript function from c++ in cocos2d-x
and https://discuss.cocos2d-x.org/t/how-to-call-js-functions-in-c-class/6243/3 But these solutions are old.
Got the solution. Below link solved my problem :-
https://discuss.cocos2d-x.org/t/evalstring-function-is-missing-js-function-call-from-objective-c/47530
I have come across a variable in javascript called window.sitedata but tried to search the details regarding it but unable to find.
Can some explain what is window.sitedata in java script ? what is its purpose, any documentation regarding it would be helpful.
I think window.sitedata is not available. Refer below link for window object properties.
https://www.w3schools.com/js/js_ex_browser.asp
FYI
https://developer.mozilla.org/en-US/docs/Web/API/Window
sitedata is a custom variable because the native window object does not have a property called sitedata.
You may ask (if possible) the programmer who developed the code.
Reference:
W3Schools
MDN
I'm exploring to embedded D3/DC visualizations with WT(Witty) Webpage.
Is it possible to use javascript functions with WT?
The answer is yes you can.You can use jsslot and call the javascript code by WApplication::doJavaScript().
Please have a look here.
I'm creating an extension for Chrome (Just noraml HTML/JS). I would like to make an advanced scripting mode for users.
In a form I'll put this:
function generateString(){
//EDITABLE PART
return val;
}
if somebody for example put window.location="", nothing should happen, or if somebody put myVar=55; (previously defined in my code), it shouldn't do anything either. The only thing that I want to access is the return value.
Is this possible somehow? Googled for it and found something about putting it into a iframe, but they could still do window.location="javascript:dosomehaxing()", right?
Thanks a lot!
Since nobody posted an answer in the answer section, I'll post my findings here:
From the thread that serg commented with, the question "Is It Possible to Sandbox JavaScript Running In the Browser?", JSandbox seems to be the best, lightweight option to me. Its syntax is quite simple, too.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
HTML formatter/tidy/beautifier for JavaScript
I'm looking for a good automated javascript cleaner (as in locates and fixes errors), similar to the w3c validator's cleaner function (that fixes the javascript errors).
Update: Thanks to a helpful responce I found my solution: Closure Linter.
Try jsbeautifier to beautify your code and jslint to clean up its syntax.
If I understand you correctly, you might be interested in Google's Closure Linter, which, like JSLint, validates your code and reports problems, but also provides the possibility to fix them:
(...) you can substitute fixjsstyle for gjslint to automatically fix many of the errors that gjslint checks for.
I quite like http://jsbeautifier.org/ for cleaning up Javascript.
This site is also mentioned in the answer provided by Matt in the comments.