为什么ajax刷新我的页面?

时间:2016-05-19 19:04:44

标签: jquery ajax refresh

My code

function getQuote(){
$.ajax({
    headers: {

        "X-Mashape-Key": "......",
        "Content-Type": "application/x-www-form-urlencoded",
        Accept: "application/json"
    },
    url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies',
    success: function(response) {
        var r = JSON.parse(response);
        currentQuote = r.quote;
        currentAuthor = r.author;
}

上面可能有一些语法错误,但这是因为在这里编辑代码。所以原始代码中没有语法错误。

我只想在没有刷新页面的情况下单击按钮时更改引用文本和编写器的内容。

0 个答案:

没有答案
相关问题