Adding a parameter to the URL with JavaScript

In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example: Original URL: http://server/myapp.php?id=10 Resulting URL: http://server/myapp.php?id=10&enabled=true Looking for a JavaScript function which parses the URL looking at each parameter, then adds the new parameter or updates the … Read more

How to run an EXE file in PowerShell with parameters with spaces and quotes

How do you run the following command in PowerShell? C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe -verb:sync -source:dbfullsql=”Data Source=mysource;Integrated Security=false;User ID=sa;Pwd=sapass!;Database=mydb;” -dest:dbfullsql=”Data Source=.\mydestsource;Integrated Security=false;User ID=sa;Pwd=sapass!;Database=mydb;”,computername=10.10.10.10,username=administrator,password=adminpass” 21 Answers 21

Passing a dictionary to a function as keyword parameters

I’d like to call a function in python using a dictionary. Here is some code: d = dict(param=’test’) def f(param): print(param) f(d) This prints {‘param’: ‘test’} but I’d like it to just print test. I’d like it to work similarly for more parameters: d = dict(p1=1, p2=2) def f2(p1, p2): print(p1, p2) f2(d) Is this … Read more

“Parameter” vs “Argument” [duplicate]

This question already has answers here: What’s the difference between an argument and a parameter? (36 answers) Arguments or parameters? [duplicate] (12 answers) Closed 2 years ago. I got parameter and argument kind of mixed up and did not really pay attention to when to use one and when to use the other. Can you … Read more

Pass a JavaScript function as parameter

How do I pass a function as a parameter without the function executing in the “parent” function or using eval()? (Since I’ve read that it’s insecure.) I have this: addContact(entityId, refreshContactList()); It works, but the problem is that refreshContactList fires when the function is called, rather than when it’s used in the function. I could … Read more

What’s the difference between an argument and a parameter?

When verbally talking about methods, I’m never sure whether to use the word argument or parameter or something else. Either way the other people know what I mean, but what’s correct, and what’s the history of the terms? I’m a C# programmer, but I also wonder whether people use different terms in different languages. For … Read more

How can I pass a parameter to a setTimeout() callback?

I have some JavaScript code that looks like: function statechangedPostQuestion() { //alert(“statechangedPostQuestion”); if (xmlhttp.readyState==4) { var topicId = xmlhttp.responseText; setTimeout(“postinsql(topicId)”,4000); } } function postinsql(topicId) { //alert(topicId); } I get an error that topicId is not defined Everything was working before I used the setTimeout() function. I want my postinsql(topicId) function to be called after some … Read more