문제

I need to load a dynamic created javascript with PHP. Is there any good solution to load javascript creating by PHP after some ajax requests finished?

Thx in regards, i am searching for 2h in stackoverflow.

if i call .ajax function where html/js respone, jquery kills the js ;/

도움이 되었습니까?

해결책

jQuery.ajax({
    type: 'POST',
    dataType: 'html',
    url: $url,
    success: function(result)
      { 
         result // html

         jQuery.ajax({
     type: 'GET',
     dataType: 'script',
         url: $url,
         success: function(result)
            { 
            //the result is js and is availble in browser if you return 
            //a function you can execute this now

            }
          });

      }
});

Hope someone find his answer here :) gl & hf & nice day

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top