Hello everybody m trying to pass a parameter to my controller.php from javascript but it doesn't passing and give me error of undefined URL kindly help me i shall be thankful to you...Here is my code

function JSfunction(assetid)
{
window.location="controller.php?command=delete&assetid=".assetid;
}

String concatenate operator :-

  • Javascript: +
  • PHP: .
window.location = "controller.php?command=delete&assetid=" + assetid;

Moving between php and js to get some app working, I've done the same - many times.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.