Json Calls with Jquery

The calling html part:

<script src=""></script>
<script src="test.js" type="text/JavaScript"></script>
<form onsubmit="" action="" method="POST" name="myform">
    <input type="hidden" name="paramvalue" value="testvalue" id="paramvalue"/>
    <input type="button" onclick="javascript:getData()" value="Generiere Ausgabe"></input>
<div name="dummy" id="dummy"></div>

the running javascript

function getData(){
    if (document.getElementById('paramvalue')) {
			var fldparam = document.getElementById('paramvalue');
			param = fldparam.value;
			var sap_data = document.getElementById('dummy');
			sap_data.innerHTML = param;
			$.getJSON( "test.php", function( data ) {

the value generating php

    set_time_limit ( 60 );	//prevents timeouts
	echo json_encode('Hello World');

Leave a Reply

Your email address will not be published. Required fields are marked *


Get every new post on this blog delivered to your Inbox.

Join other followers: