почему мой javascript в вызываемом ajax не работает? с JQuery - PullRequest
0 голосов
/ 19 июня 2011

ок, допустим, я делаю что-то вроде

http://localhost/ajax/social/pull/facebookstatus

на моем /ajax/social/pull/facebookstatus, есть сценарий, похожий на

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      // Load the Visualization API and the piechart package.
      google.load('visualization', '1', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table, 
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

      // Create our data table.
      var data = new google.visualization.DataTable();

, вернемся к проблеме imпытается вызвать (скажем, на http://localhost/myprofile)

    $.ajax({  
        type: "POST",                    // Using the POST method  
        url: "/ajax/social/pull/facebookstatus",      // The file to call  
        data: myfbdata, 
        dataType: 'html',
        success: function(data) {
        $('#ajax-placeputfb').hide().fadeIn(3000).html(data);
        }  
    });

скрипт на /ajax/social/pull/facebookstatus не работает, когда он загружен на http://localhost/myprofile

есть проблема?

Спасибо

Адам Рамадан

1 Ответ

0 голосов
/ 19 июня 2011

это связанный вопрос? При загрузке html-страницы через ajax будут загружаться теги скрипта?

Подобная проблема возникла, когда библиотека не была включена в <head>

Может быть, вы можете попробовать включить это в тег <head> вашего основного документа

<script type="text/javascript" src="https://www.google.com/jsapi"></script>

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...