English 中文(简体)
仅在装满一页后使用自动自动备用金
原标题:Use AJAX result only after page was loaded

一俟执行联合材料,便可使用<代码>$.get(>> 电话,可在$(文件)>上查询。 一旦启动<代码>$.get,我怎么能使用这一结果? 在<代码>$(文件)>$()启动后,我不想寄出<代码>$.get(。


<>Solution: 正如乔纳森·朱利安提到的那样,我参加了这一解决办法:

$.get( my_script.php , function(data) {
  $(document).ready(function() {
    // I can use data here as soon as document is available! 
    // No flickering of the updated div! :)
  });
});
最佳回答

缩略语 手稿,在<代码>$(文件)ready(功能中,你需要做些什么。 它要么放弃,要么等到文件准备就绪。

问题回答

网页一旦能够放火,就能够放火文件,你可以拖延,也毫无理由,无论哪怕想到,用哪一种更好的方法做。

界定全球范围的一个变量,并从中储存价值。 以后,你可以在任何地方使用。





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签