我试图用Ajax发布帖子请求,但它不起作用。 在下面的代码中,第一个警报出现,但成功函数内的第二个警告不会出现。
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery-2.1.4.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
testscore ="tryagaiDDDn"; //testvalue to enter into the mysql database
alert("xoa"+testscore);
$.ajax({
type: "POST",
url: "chatp.php",
data: { 'tryagain':tryagain },
success : function(data){
alert(data);
}
});
});
});
</script>
</head>
</html>
由于
答案 0 :(得分:1)
import nltk
import numpy
import pip
import pdfminer
import dateutil
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from cStringIO import StringIO
def convert_pdf_to_txt(path):
rsrcmgr = PDFResourceManager()
retstr = StringIO()
codec = 'utf-8'
laparams = LAParams()
device = TextConverter(rsrcmgr, retstr, codec=codec, laparams=laparams)
fp = file(path, 'rb')
interpreter = PDFPageInterpreter(rsrcmgr, device)
password = ""
maxpages = 0
caching = True
pagenos=set()
fstr = ''
for page in PDFPage.get_pages(fp, pagenos, maxpages=maxpages, password=password,caching=caching, check_extractable=True):
interpreter.process_page(page)
str = retstr.getvalue()
fstr += str
fp.close()
device.close()
retstr.close()
return fstr
test1 = convert_pdf_to_txt("C:\Users\User\Documents\Contract\Dental\Certificate - Dental - Assurant - 2010.pdf")