我使用过SimpleModal.现在的问题是调整模式对话框的大小.我有一个确认对话框,按下是后它基本上很小.
第二个是my.php,它包含大数据.我正在使用附加已有模型的概念.如何调整内容的大小?
我的JavaScript代码段包含:
$(document).ready(function () {
$('#confirmbutton, #confirmDialog a.confirm').click(function (e) {
e.preventDefault();
confirm("Continue to the SimpleModal project page?", function () {
window.location.href = 'http://localdata/';
});
});
});
function confirm(message, callback) {
$('#confirm').modal({
close:false,
position: ["20%",],
overlayId:'confirmModalOverlay',
containerId:'confirmModalContainer',
onShow: function (dialog) {
dialog.data.find('.message').append(message);
// If the user clicks "yes"
dialog.data.find('.yes').click(function () {
// Call the callback
// $.modal.close();
$.get("my.php", function (data) {
/* Sample response:
* <div id="title">My title</div>
* <div id="message">My message</div>
*
*/
var resp …Run Code Online (Sandbox Code Playgroud) 我正在使用PHP和JavaScript.我的JavaScript代码包含一个函数get_data():
function get_Data(){
var name;
var job;
.....
return buffer;
}
Run Code Online (Sandbox Code Playgroud)
现在我有以下PHP代码.
<?php
$i=0;
$buffer_data;
/* Here I need to get the value from JavaScript get_data() of buffer;
and assign to variable $buffer_data. */
?>
Run Code Online (Sandbox Code Playgroud)
如何将JavaScript函数数据分配到PHP变量中?
我正在使用PHP/jQuery和JavaScript.我正在使用Firebug在Firefox中测试JavaScript代码.Internet Explorer有类似的东西吗?
我正在努力让它在Internet Explorer 7和Internet Explorer 8中看起来/工作相同.
有没有工具可以解决这个问题?还是我需要遵循的标准?而且,可以推荐什么调试器?
ID NAME COST PAR P_val S_val 1 X 5 0 1 0 1 y 5 0 2 0 1 z 5 0 0 5 2 XY 4 0 4 4
我需要用ID分组更新PAR字段SUM(S_val):
PAR应该是SUM(SVAL) WHERE ID=1PAR应该是SUM(SVAL) WHERE ID=2ID NAME COST PAR P_val S_val 1 X 5 5 1 0 1 y 5 5 2 0 1 z 5 5 0 5 2 XY 4 4 4 …
我正在使用JavaScript和jQuery.我的主文件My.js和Ajax.
function build_one(){
alert("inside build_one");
}
Run Code Online (Sandbox Code Playgroud)
<script type="text/javascript">
..
// Here I want to make call function defined in My.js build_one()
..
// Here is the Ajax call
$.ajax({
type:'POST',
url: 'ajax.php',
data:'id='+id ,
success: function(data){
$("#response").html(data);
}
});
...
</script>
Run Code Online (Sandbox Code Playgroud)
如何在Ajax函数之前调用build_one()函数?
我正在使用JavaScript,jQuery和PHP.如何限制JavaScript函数执行一次?
我的MainJQuery文件有Ajax.display.php执行一段时间:
....
$.ajax({
type:'POST',
url: 'display.php',
data:'id='+id ,
success: function(data){
$("#response").html(data);
//Here Get_list should be execute only once.
get_list('get');
// Display should execute as usual
display();
}//success
}); //Ajax
.......
Run Code Online (Sandbox Code Playgroud)
get.Php文件将值写入JavaScript:
<?php
print "<script language='javascript'>";
print " g_cost[g_cost.length]=new Array('STA-VES','East',4500);";
print " g_cost[g_cost.length]=new Array('STA-CRF','West',5400);";
print "</script>";
?>
Run Code Online (Sandbox Code Playgroud)
我的JavaScript函数具有PHP的以下值:
function get_list('get'){
for(var i=0;i<g_cost.length;i++)
var temp = g_cost[i];
var Name = temp[0];
var direction = temp[1];
var cost = temp[2];
..
some code
...
}
function display(){
for(var i=0;i<g_cost.length;i++)
alert(g_cost.length);
var temp …Run Code Online (Sandbox Code Playgroud) 我有一些jQuery代码.我调用了一个Ajax函数文件file.php,它有一些字段,比如:
<input type="radio" value="plz">Milk</input>.
Run Code Online (Sandbox Code Playgroud)
我会再分配到jQuery函数吗?如果是这样,我该怎么办?我附上了一个示例文件:
<html>
<head>
<LINK REL=StyleSheet HREF="examples.css" TITLE="Contemporary" TYPE="text/css">
<script src="jquery-1.2.6.js" type="text/javascript"></script>
<script src="jquery-impromptu.1.6.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$.ajax({
type:"GET",
url:"file.php",
data:id,
success:function(){
var txt=id;
$.prompt( txt,{ opacity: 0.2 });
},
error:function(){
window.location("ERRoR");
}
});
});
</script>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我有两页jQuery,Page1和Page2,我可以在Page1中获得输入.
的somval=1000$.
第1页用户输入somevalue.我存储了值:
var val = somval;
Run Code Online (Sandbox Code Playgroud)
现在在第二页中,我需要在第1页中获得somvalue的结果.当然,分别使用My1.js My2.js的两个页面.
如何将一个jQuery文件中的值与其他JavaScript共享,或者如何从page1值获取值到page2?
我该如何解决这个问题?
我正在使用jQuery.当警报列表的ID显示两次而不是一次时,我遇到了问题.
列表:
<ul id="testnav">
<li> <a href="#">Page 1</a></li>
<li> <a href="#">Page2..</a>
<ul id="subnav">
<li id="content_1"><a href="#"> Page3</a></li>
</ul>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
代码:
$("li").click(function(){
var current_id = $(this).attr('id');
alert(current_id);
// These alert two times, one is empty and another one is content_1
});
Run Code Online (Sandbox Code Playgroud)
为什么编码代码警报两次?如何让它执行一次?
jquery ×8
javascript ×4
ajax ×3
php ×3
execution ×1
function ×1
list ×1
model ×1
mysql ×1
popupwindow ×1
resize ×1
return ×1
return-value ×1
sql ×1