html 使用ajax php函数吗,php – 为什么用AJAX加载html后jQuery更改函数不起作用?
我加載一個表單并從
PHP文件中通過AJAX動態填充select.在實現動態AJAX填充選擇之前,我的更改功能正常工作(當用戶選擇“其他”時,它只顯示另一個輸入).現在更改功能不起作用.
我知道ready函數正在觸發,因為jStepper函數運行.我已嘗試使用ready函數內外的更改函數.我覺得在AJAX get完成之前加載了更改函數,但這真的很重要嗎?
var types = "";
var d = new Date();
$.get('scripts/vehicle_category_feed.php?date=' + d.getTime(), function ($type)
{
$($type).find('type').each(function ()
{
types += "" + $(this).attr("category") + "";
});
types += "Other(Specify)";
$('#ve_categoryNo_td').html(types);
});
$(document).ready(function ()
{
$('input[type=text]').click(function ()
{
$(this).select();
});
$('#vehicle_entry').ajaxForm(function ()
{
showMessage('vehicle_information_added');
});
$('#ve_ariNo').jStepper({minValue: 1, maxValue: 99999999});
$('#ve_fleetNo').jStepper({minValue: 1, maxValue: 999999999});
$('#ve_vehicleYear').jStepper();
$('#ve_purchasePrice').jStepper({minValue: 0});
$('#ve_categoryNo').change(function ()
{
if ((this.value) == "other")
{
$('#otherCategory').show();
$('#otherCategory input[type=text]').focus();
} else
{
$('#otherCategory').hide();
}
});
});
總結
以上是生活随笔為你收集整理的html 使用ajax php函数吗,php – 为什么用AJAX加载html后jQuery更改函数不起作用?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java笔试题递归,递归(网上搜的一些笔
- 下一篇: php 身份认证服务,PHP的HTTP身