我通过正常的AJAX调用从表单传递数据。我现在需要做的是通过elat
和elng
通过AJAX数据包含filter.serialize()
和elat
elng
值的最佳方法是什么?
var elat = place.geometry.location.lat();
var elng = place.geometry.location.lng();
var filter = $('#filter');
$.ajax({
url: filter.attr('action'),
data:filter.serialize(), //Pass [elat] and [elng] through here too.
type: 'POST',
dataType: 'json',
success: function(response) {
}
});
答案 0 :(得分:2)
您可以手动连接到data:filter.serialize() + '&elat=' + elat + '&elng=' + elng,
filter.append( $('<input>',{type:'hidden', name:'elat'}).val(elat));
filter.append( $('<input>',{type:'hidden', name:'elng'}).val(elng));
或者在序列化之前向表单添加隐藏的输入。
Sub CreatePres()
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Dim ppTextbox As PowerPoint.Shape
Set ppApp = New PowerPoint.Application
ppApp.Visible = True
ppApp.Activate
Set ppPres = ppApp.Presentations.Add
slidesCount = ppPres.Slides.Count
Set ppSlide = ppPres.Slides.Add(slidesCount + 1, ppLayoutTitle)
ppSlide.Shapes(1).TextFrame.TextRange.Text = "Hello world"
ppSlide.Shapes(2).TextFrame.TextRange.Text = Date
slidesCount = slidesCount + 1
Call slide2(slidesCount)
End Sub
Sub slide2(i As Integer)
Set ppSlide = ppPres.Slides.Add(i + 1, ppLayoutTitle)
ppSlide.Select
ppSlide.Shapes(1).TextFrame.TextRange.Text = "Hello world"
ppSlide.Shapes(2).TextFrame.TextRange.Text = Date
End Sub