Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- submithash = {}
- submithash['standard_id'] = $("#app_standard_id").val()
- submithash['apps'] = apps
- hash = { type: "POST", url: "create_all", data: submithash }
- $.ajax(hash)
- $form = $("<form>").attr("method", "post").attr("action", "create_all")
- $("<input type='hidden'>").attr("name", "standard_id").attr("value", $("#app_standard_id").val()).appendTo($form)
- $("<input type='hidden'>").attr("name", "apps").attr("value", apps).appendTo($form)
- $form.submit
- hash = { type: "POST",
- url: "create_all",
- data: submithash,
- success: function(data){
- //Here you can write your redirection code
- //this function will be called when ajax completes successfully
- window.location = "url"//redirect url;
- //or you can also start another ajax
- }
- };
- $.ajax(hash);
- (function($) {
- $.extend({
- getGo: function(url, params) {
- document.location = url + '?' + $.param(params);
- },
- postGo: function(url, params) {
- var $form = $("<form>")
- .attr("method", "post")
- .attr("action", url);
- $.each(params, function(name, value) {
- $("<input type='hidden'>")
- .attr("name", name)
- .attr("value", value)
- .appendTo($form);
- });
- $form.appendTo("body");
- $form.submit();
- }
- });
- })(jQuery);
Add Comment
Please, Sign In to add comment