adding php func in js

[ad_1]

I want to write this php function <?php wp\_dropdown\_users( array( ‘name’ => ‘user\[\]’ ) )

which brings a list of users to a table that is being added in javascript

var row = $(“<tr><td> <?php wp\_dropdown\_users( array( ‘name’ => ‘user\[\]’ ) ) </td><td>);

but it’a not working, I’ve tried doing this

var my\_var1 = “<?php wp\_dropdown\_users( array( ‘name’ => ‘user\[\]’ ) ) ?>”;

&#x200B;

var row = $(“<tr><td>”+my\_var1+”</td><td> “);

but an error occurs “caught SyntaxError: Invalid or unexpected token”

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer