Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //php часть 1
- go('confirm');
- // php часть 2
- function go($url){
- exit('{"redirect" : "'.$url.'"}');
- }
- // js часть
- // AJAX Запросс пережача данных на go.form
- function post_query(url, name, data)
- {
- var str = '';
- $.each(data.split('.'), function(k, v) {
- str += '&'+ v + '=' + $('#' + v).val();
- } );
- $.ajax(
- {
- url: '/' + url,
- type: 'POST',
- data: name + '_f=1' + str,
- cache: false,
- success: function(result) {
- obj = jQuery.parseJSON(result);
- if(obj.go) go(obj.go);
- else alert(obj.message);
- }
- });
- }
- function go(url) {
- window.location.href='/' + url;
- }
Advertisement
Add Comment
Please, Sign In to add comment