我正在尝试利用JQuery Ajax调用JavaScript文件。我需要传递一些参数,但我不确定如何使用JavaScript(PHP似乎更简单)。这里是我的电话:调用JS文件时从JQuery Ajax调用中检索参数
function getDocument(parameters) {
$.ajax({
type: "GET",
url: "js/document.js",
dataType: "script",
data: "info=hellothere",
success: function(msg) {
},
error: function(jqXHR, textStatus, errorThrown){
}
});
}
所有我想要做的,是打印出document.js
参数“信息”的内容,所以基本上是应打印“hellothere”。