Tamamlanmış

Simple Javascript parsing JSON data

I have a php file that generates JSON data but I want some javascript that will parse that PHP script and if it is blank then redirect to another page else just continue to load the page.

Something like this but I just can't get it to work.

<script type="text/javascript">

var data = $.ajax({

type: 'GET',

url: '[url removed, login to view]',

dataType: 'JSON',

timeout: 5000,

success: function(data) {

if (data == '') { //If the JSON data is blank then redirect to another page

[url removed, login to view] = "[url removed, login to view]";

} else {

//continue loading the page

}

});

});

</script>

Beceriler: HTML, Javascript, jQuery / Prototype, PHP

Daha fazlasını gör: get location javascript, text parsing, simple javascript, json, json script, json c, javascript html parse, javascript load file, load json file php, php parsing text, javascript parse html json, parse html javascript, php html parsing, text javascript, JavaScript JSOn, parse javascript, json simple, php parse json, parse json html, html parse html json

İşveren Hakkında:
( 12 değerlendirme ) Rocklin, United States

Proje NO: #6350524

Seçilen:

kotiantal

Hello! I am Antal, i can do this job easily and fast, if you interest message me, i can do it right now. Thanks, Antal

%selectedBids___i_period_sub_7% gün içinde 15%project_currencyDetails_sign_sub_9% %project_currencyDetails_code_sub_10%
(16 Değerlendirme)
4.1

Bu iş için 3 freelancer ortalamada $18 teklif veriyor

tanseercena

A proposal has not yet been provided

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(11 Değerlendirme)
3.8
L0veToWork

A proposal has not yet been provided

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(7 Değerlendirme)
3.6
rubytopcoders

Hello, I am expert PHP & Javascript, and i am very interesting this project! Hope to work with you! Best regards, LEO

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(4 Değerlendirme)
3.0