executing script after jQuery Ajax Call

前端 未结 2 481
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 19:22

I load some HTML code into a div with the .load function af jQuery that contains some code I want to execute;

$.ajax({
    type: \"GET\",
    url: url,
    dataT         


        
2条回答
  •  囚心锁ツ
    2021-01-21 20:02

    Probably you should use jQuery.getScript to loading some javascript from the server and execute it.

    UPDATED: In the most cases one load only the pure HTML fragment with respect of jQuery.ajax. Binding of elements to some javascript functions one do inside of success handle. All functions which one use in any event handler one loaded before (with

提交回复
热议问题