weixin_33744141 2012-10-24 17:49 采纳率: 0%
浏览 17

加载窗口后执行一些操作

I'm doing a (simple) ajax call on window load:

$(window).load(function () {

$.ajax({
url: someUrl,
type: "get",
dataType: "",
success: function(data) {

           ...........

How can I do something, for instance a function or event after this ajax proces is finished. The problem is I have to append something to the data recieved by the ajax call. But I can't append on window load because the data is still being processed.

  • 写回答

6条回答 默认 最新

  • 零零乙 2012-10-24 17:51
    关注

    Put it in the success handler of the ajax call:

    $(window).load(function () {
        $.ajax({
            url: someUrl,
            type: "get",
            dataType: "",
            success: function(data) {
                // do whatever you want with data
            }
        });
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器