Created
December 4, 2016 11:26
-
-
Save anonymous/45f5e7c3af1bb101ca7e3858eeb663c2 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
<script> | |
function createFile() | |
{ | |
var fileName; | |
fileName= prompt("Please enter file name:"); | |
if (fileName != null ) | |
{ | |
if(fileName.trim()=="") | |
{ | |
alert("File name must have some value"); | |
} | |
else | |
{ | |
alert("File is created"); | |
jQuery.ajax( | |
{ | |
type: "POST", | |
url: 'database_connections.php', | |
dataType: 'json', | |
data: {functionname: 'add', arguments: [fileName]}, | |
success: function (obj, textstatus) | |
{ | |
if( !('error' in obj) ) | |
{ | |
var yourVariable = obj.result; | |
} | |
else { | |
console.log(obj.error); | |
} | |
} | |
}); | |
alert("File is created"); | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment