I'm trying to pass some parameter to a function used as callback, how can I do that?  function tryMe (param1, param2) {     alert (param1 + " and " + param2); }  function callbackTester (callback, param1, param2) {     callback (param1,...
Often I will have a JavaScript file that I want to use which requires certain variables be defined in my web page.  So the code is something like this:  <script type="text/javascript" src="file.js"></script> <script t...
I am new to JavaScript/jQuery and I've been learning how to make functions. A lot of functions have cropped up with (e) in brackets. Let me show you what I mean:  $(this).click(function(e) {     // does something });   It always appears that th...
I'm preparing some variables in JavaScript (in my specific case, I'd like to get GPS location):  function getVars() {     // ...     var x = locationInfo.lng;      var y = locationInfo.lat; }   I'd like to send them to my managed bean v...
I have a radwindow that I use to show error messages to users in an application. My goal is as below; If the message is not a warning/error I want user to be redirected when they click "OK" on the popped up radwindow. To accomplish this, I&...
We have a requirement to run python scripts from Javascript. We have to pass an input String to the python script as an argument, and display the python output onto our web page.  Here is the Python code, this code works fine when I run this in my li...
I have one function with two parameters, for example function (a,b). I want to within the function, take the value of b, and replace that with c. I was thinking of something like $(b).replaceWith(c), but it didn't work out. I know I can create a...
How can I have a function accept either named arguments (foo({a: 'hello', b: 'it is me'})) or positional arguments (foo('hello', 'it is me'))?  I understand that named arguments can be simulated by passing an object to...
I'm a newbie in the JavaScript world, and I came up with this weird problem when i was attempting prototype chaining inheritence.  I have 3 classes   //class parent function parent(param_1){     this.param = param_1;     this.getObjWithParam = fu...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.