I have a quick question on JavaScript:
I have the following line of code shows an example and it works fine. You can access passeddata there are no issues.
$.getJSON(jsonUrl,function(passeddata){
alert("it worked ");
});
The next code sample does not work and fails with the following error:
Uncaught TypeError: Object ReferenceError: passeddata is not defined has no method 'replace' jq.html:177 (anonymous function)
$.getJSON(jsonUrl, something(passeddata));
function something(passeddata)
{
var jasondata = passeddata;
alert("it worked ");
}
Can someone explain the issue? I know its probably something obvious, but I'm just not able to find an answer.
(passeddata)from$.getJSON(jsonUrl, something(passeddata));.