background preloader

Suporte - Tutorial - KnowHow

Facebook Twitter

Do you want to use JSON but don’t know where to start. As time passes, and as 2.0 web applications become more popular, AJAX has become leader in the transfer of asynchronous data. Having said that, it has become evident that there’s a need for a language which is versatile, easy to use and able to communicate with various programming languages: JSON has all of these characteristics. In this article we will discover JSON, its syntax and show you an example of how it should be used inside a web application. JSON stands for JavaScript Object Notation and it is a type of format which stores various types of information, and allows this information to be shared between client and server applications.

One of its strenghts is in regards to data writing and data analysis; developers using this format will benefit considerably from this characteristic. In confirmation of what we’ve just said, Yahoo! This does not mean that XML is better than JSON or viceversa; JSON is a really simple and versatile language to use, which requires a more in-depth look. Json tutorial for beginners learn how to program part 2 Ajax JavaScript. Part 2 of learning JSON for beginners with Adam. JSON stands for JavaScript Object Notation. It is a lightweight format for creating and sending data objects. JSON is a part of JavaScript and not a separate entity, the notation syntax is built into the raw Javascript programming language as a subset.

In part 2 we focus on the Ajax request and parsing return objects in a smart compact JavaScript for loop. function ajax_get_json(){ var results = document.getElementById("results"); var hr = new XMLHttpRequest(); hr.open("GET", "mylist.json", true); hr.setRequestHeader("Content-type", "application/json", true); hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { var data = JSON.parse(hr.responseText); results.innerHTML = ""; for(var obj in data){ results.innerHTML += data[obj].user+" is "+data[obj].age+" and lives in "+data[obj].country+"<hr />"; hr.send(null); results.innerHTML = "requesting. Json tutorial for beginners learn how to program part 2 Ajax JavaScript. Funções do MySQL no PHP. Algumas funções MySQL no PHP e suas respectivas utilidades: mysql_affected_rows() Retorna o número de linhas afetadas com a última query usando INSERT, UPDATE ou DELETE associado com o link_identifier.

Se o link de identificação não for especificado, o último link aberto pelo mysql_connect() é assumido. mysql_change_user() Muda o usuário entrado da conexão ativa atual, ou a conexão dada pelo parâmetro mais link_identifier que é opcional. Se um banco de dados for especificado, esta optará pelo banco de dados atual(default) depois que o usuário foi mudado. Mysql_client_encoding() Retorna o conjunto de caracteres padrão para a conexão atual. mysql_close() Fecha uma conexão, não persistente, aberta em um Banco de Dados MySQL. mysql_connect() Estabelece uma conexão com um Banco de Dados MySQL. mysql_create_db() Cria um novo banco de dados no server associado com o link. mysql_data_seek() mysql_db_name() Examina o primeiro parâmetro do ponteiro do resultado de um atendimento ao mysql_list_dbs().

Curso de Eletrônica Geral. MockFlow Wireframe. DFF and Open Source digital forensics community. PHP Tutorial.