Created
September 15, 2014 05:27
-
-
Save svolpe43/71d4e65278219d14d05c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* My javascript | |
* | |
**/ | |
$("#moduleform").submit(function(e){ | |
$.ajaxSetup({ headers: { 'X-CSRF-Token' : $('meta[name=_token]').attr('content') } }); | |
e.preventDefault(); | |
var name = $("input#modname").val(); | |
var token = $("input[name=_token]").val(); | |
var type = $("input:radio[name=type]:checked").val(); | |
var dataString = 'name='+name+'&type='+type+'&token='+token; | |
console.log(dataString); | |
$.ajax({ | |
type: "POST", | |
url : "http://training/dashboard/edit/module", | |
data : dataString, | |
success : function(data){ | |
console.log('Hello'); | |
//document.getElementById('##').innerHTML = data; | |
} | |
},"json"); | |
}); | |
/* | |
* My route | |
* | |
**/ | |
Route::post('dashboard/edit/module', array('before'=>'csrfajax', function(){ | |
return View::make('home'); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment