我有这个脚本用于向我的数据库提交一些数据.它在1.4.2上运行良好,但我使用的模板需要1.9.1,所以我更新了我的网站.我遇到的问题是,当我尝试调用相同的函数时,我现在遇到错误.
这是我的js代码:
function drilldown(row_id){
var dealID = document.getElementById('dealID'+ row_id).value;
var specialnotes = document.getElementById('specialnotes'+ row_id).value;
var ready = document.getElementById('ready'+ row_id).value;
var initials = document.getElementById('initials'+ row_id).value;
var forcust = document.getElementById('forcust'+ row_id).value;
var notes = document.getElementById('notes'+ row_id).value;
$.ajax({
url: "savedrilldown.php",
type: "GET",
//pass data like this
data: {dealID:dealID,specialnotes:specialnotes,ready:ready,initials:initials,forcust:forcust,notes:notes},
cache: false,
success: function(data) {
if (data=="1")
alert("Record updated!" );
}
});
}
Run Code Online (Sandbox Code Playgroud)
这是firebug向我展示的错误:
TypeError: $ is undefined [Break On This Error]
$.ajax({
Run Code Online (Sandbox Code Playgroud)
这是我正在加载的内容:
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery-migrate-1.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
任何建议将不胜感激.非常感谢.
我有一个php echo语句,用于循环中的复选框:
echo "<input name='battery[$i]' type='checkbox' id='battery[$i]' value='Yes' style='margin-top:10px; margin-left:15px;' />";
Run Code Online (Sandbox Code Playgroud)
我想根据查询结果将此条件添加到它:
<?php if($rowbill['battery'] == "Yes") print "checked"; ?>
Run Code Online (Sandbox Code Playgroud)
但我很难获得连接的正确语法,请一些帮助将不胜感激.
我有这个脚本来附加一组输入字段.它工作正常,除了我的问题,每次我点击按钮添加在页面中间,页面跳转到页面的顶部.怎么能阻止它跳到顶端?对不起,这是追加脚本:
var count = 0;
$(function(){
$('a#add_field').click(function(){
count += 1;
$('#activation').append(
'<div id="features_remove" style="float:left; width: 11%; margin-left:115px;">'
+'<label>features remove</label>'
+'<select id="features_remove' + count + '" name=features_remove' + count + '" class="input-medium" >'
+'<option value="" selected=" " > </option>'
+'<option value="MPP" >MPP</option>'
+'<option value="50 Data" >50 Data</option>'
+'<option value="Navigation" >Navigation</option>'
+'<option value="Insurance" >Insurance</option>'
+'<option value="Road Side Assistance" >Road Side Assistance</option>'
+'</select>'
+'</div>'
);
});
});
Run Code Online (Sandbox Code Playgroud)
是的,这是一个按钮
<a href="#" class="btn btn-mini btn-danger" id="add_field"><span>Add In-Store Activation</span></a>
Run Code Online (Sandbox Code Playgroud)