English 中文(简体)
j Query Ajax Call后执行书
原标题:executing script after jQuery Ajax Call
  • 时间:2010-08-18 16:02:34
  •  标签:
  • jquery
  • ajax

我把一些超文本装成一整条,载荷功能 a,其中载有我想执行的一些法典;

$.ajax({
    type: "GET",
    url: url,
    dataType: "html",
    success: function(data){
        //.....
   }
 });

在装满Ajax(ajax)要求发出警报后,功能运转,但一些功能胜出。

$(document).ready(function(){
    alert( TEST ); //this works
    someFunction("#debug", var );//this doesn t
});

我如何从Ajax呼吁中履行这一职能

作为<代码><a onclick=”someFunction(执行的职能要么赢得了t work。

最佳回答

不妨使用jQuery.getgust,从服务器上装载一些javascript并加以执行。

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 <script> in the <head> block) on the main page (on the page which call jQuery.ajax). Then all look very clear and dynamic loading of any scripts is not needed.

问题回答

你们为什么会利用你所呼吁的警示职能?

$.ajax({
type: "GET",
url: url,
dataType: "html",
success: function(data){
    alert( TEST ); //this works
    someFunction("#debug", var );//this doesn t
}});

我将更仔细地研究一下你是如何设计法典的。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签