Create Html template document from Javascript and Php variables [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am developping an application. As final result the application generates a Html document consisting of variables from external Javascript and Php files.Which is the safest way to pass these variables?.
Thank you very much.

You can use AJAX to do this, you make the request in JS, and process the information in PHP(server side), and you can return an JSON Object with the variables, or simply, return the HTML code and output it.
Hope it helps :D

Related

How can I create a web app to edit a large JSON manually? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
I have a large JSON file, about 100 MB in a folder. I'd like to manually inspect some attributes, and then add more attributes to some of the objects and finally save changes and get output a modified json file.
Can someone suggest me how to do that?
I wanted to try with vue.js framework but I'm not very expert. If you know a video tutorial about this, please let me know.
Is using vanilla JavaScript the right choice or not?

Can data from a db be displayed on a web page? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a very simple question: when loading a web page the Page_Load function is called so that the page can be loaded. In this function can I insert some code that allows me to select and view in the browser the data present in an external database?
This answer could be of help.
You could then write a script that fetches data from a database. How you do that is a question in it self but I can recommend checking out w3schools which is good for learning plain Javascript in the beginning.

Is it bad practice to combine PHP and HTML? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
This may be a small question, but I haven't found any direct answer yet. Is it considered bad practice to use PHP alongside HTML? (using PHP foreach for example in combination of with HTML)
I have searched on Google and I didn't find a direct answer. Another example: What should I do when an user logs in on a website. Do I store the important information with $_SESSION (PHP) or should I store it with sessionStorage(Javascript)?
1) HTML and PHP go hand in hand, and unless you know one of the two languages ​​you have to use them together
2) you should save the information with the $ _SESSION of php and destroy them every time a user logs-out

How to transfer JavaScript variables to PHP [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I've got a problem. I don't know how to transfer JS variables to PHP.
In JS I've got my main script and I'm using PHP only to file management but I need some variables from JS.
The short answer is AJAX, (or SOAP but you better go with AJAX). So go do a little research on it, and if you know jQuery or Prototype or something similar, you are pretty much off for starting to code in a new technology in minutes.
Here are some links, to get you started:
How to start learning Ajax?
http://api.jquery.com/jquery.ajax/

How to Avoid HTML in JavaScript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a lot of elements that are created on the fly from data received on the server, as JSON. To create these elements a lot of HTML is going inside my JavaScript code. Is there any solution to this problem? The JavaScript code is polluted and writing HTML tags becomes harder and less maintainable.
Templating tools such as handlebars, mustache and dust.js were designed to solve this very problem.
Ember.js is another alternative that allows you to remove HTML from your JavaScript through their templating tool called HTMLBars.
Check it out!

Categories

Resources