Using Google Analytics to track AJAX requests

前端 未结 3 1840
夕颜
夕颜 2021-01-05 20:53

I\'m changing a big section of a website to use jQuery Address\' deep linking AJAX features. I\'m using URIs like mysite.com/#!/page1/subpage/ and so on.

<
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-05 21:17

    I use a system that involves requesting the html as plain text, parsing the html first to change all script tags into divs, detach those divs, append the page, then loop through the divs (that are actually scripts) and append their contents to script tags or create script tags with the src on that div. It is very similar to how the history.js framework example does it.

    $.get(urlToLoad).promise().done(function(html) {
        var outHTML = html;
        outHTML = outHTML.replace(/
    
                                     
                  
提交回复
热议问题