Javascript function help

javascript

Can someone please look at this javascript function and tell me tell me what I am doing wrong? I want to pass in 4 variables. I know very little javascript.

Thanks.

  function chg(back,front,left,right)
  {
      return test("div#post", "#" + "back", "#" + "front", left, right);
  }

Here is the onload file

window.onload = function() {
  function chg(back,front,left,right)
  {
      return test("div#post", "#" + "back", "#" + "front", "left", "right");
  }
}

Best Solution

Nothing is syntactically wrong that I can see.

  • Did you mean back instead of "back"? ( same with front )
  • Is there a test function defined in an outer scope? What does it return?
  • Are the 4 arguments being populated?
  • Can you provide more code?