Pass WP data to javascript

The most direct answer to your question as it stands is “yes” – there are many ways to acquire data from WordPress without embedding it in the page’s markup or an inline <script> generated via wp_add_inline_script()/wp_localize_script(). A couple of options would be to have your JavaScript make a web request to the REST API (either one of the preexisting endpoints, or a custom one), or a custom AJAX handler.

However, note that there is no way to completely conceal data delivered to the browser from savvy users. A browser’s dev tools can be used to examine the value of any JavaScript variable, as well as inspect cookies and web requests – there’s simply no way to completely hide usable data from visitors.

If you can provide more information about your application and needs, someone may be able to offer a better solution.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)