Ajax点击只工作一次

时间:2017-03-12 10:50:12

标签: javascript jquery ajax

这个问题可能已经回答了,但我检查了现有的解决方案并试了一下,没有运气。基本上,我已经设置了一个由click事件触发的ajax加载环境,但它只适用于第一个实例。

我的js如下:

using Project.Tools;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.ViewModel
{
    public class LoginViewModel : ViewModelNavigationBase
    {
        private string _buttonText;

        public RelayCommand GoCommand { get; private set; }

        void GoToVote()
        {
            _navigationService.NavigateTo("Vote");
        }

        public LoginViewModel(IFrameNavigationService navigationService) : base(navigationService)
        {
            GoCommand = new RelayCommand(GoToVote);
        }

        public string ButtonText
        {
            get { return _buttonText; }
            set
            {
                _buttonText = value;
            }
        }
    }
}

HTML设置是基本的:

$('.load-map').each(function(){
    $(this).on('click', this, function(event) {
    event.preventDefault();

    var fileID = $(this).attr('data-level');

    $.ajax({
    url: fileID
    }).success(function (data) {
        $('#card-data').html(data);
    });

    setTimeout(function () {

    $('#myModal').on('shown.bs.modal', function () {
      })}, 1000);

    });
});

1 个答案:

答案 0 :(得分:0)

不需要每个循环:尝试这种方式!

insert into my_schema.table_d(period, valueA, valueB, valueC)
select A.Period, A.Value, B.Value, C.Value
from my_schema.table_a A

left join my_schema.table_b B
on A.Period = B.Period
left join my_schema.table_c C
on A.Period = C.Period
相关问题