流程形式变量 [英] process form var

查看:53
本文介绍了流程形式变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请仔细阅读此代码。我根本不是JS程序员,但是我不知道为什么在基本相同的上下文中为什么相同的行

在一个地方工作但是在另外,它会导致整个界面消失。


这是一个标签式界面,我只是想传递
$ f $ b在JS fxns中的options_total值。我没有得到错误输出

Javascript控制台...只是一个没有标签,面板或

表格的空白屏幕。


工作代码:用行调用


updateOptionsTotal({$ optionset_id},{$ productoption _id},this.form)

函数updateOptionsTotal(set_id ,new_option_id,form){

former_option_id = selected_options [set_id];

selected_options [set_id] = new_option_id;


options_total = eval(form.options_total.value);


....


打破:(用线路调用:

writeTabPanel(this.form);

函数writeTabPanel(form){

var tpText ='''';

tpText + =''< div id ="'';

tpText + = this.tab.id;

tpText + =''" class =" tab" ; style =" top:'';

tpText + = this.tab.top;

tpText + =''; left:'';

tpText + = this.tab.left;

tpText + =' ;宽度:;

tpText + = this.tab.width;

tpText + =" onClick =" showPanel(\'''';

tpText + = this.tab.id +''\'',\''''+ this.panel.id;

options_total = eval(form.options_total.value);

....

如果我注释掉最后一行,一切都很好 - 除了

之外,该值显然没有通过。

解决方案

optionset_id},{


productoption _id},this.form)

函数updateOptionsTotal(set_id,new_option_id,form){

former_option_id = selected_options [set_id];

selected_options [set_id] = new_option_id;


options_total = eval(form.options_total.value);


.. ..


打破:(用行调用:

writeTabPanel(this.form);

函数writeTabPanel(窗体) {

var tpText ='''';

tpText + =''< div id ="'';

tpText + = this.tab.id;

tpText + =''" class =" tab" style =" top:'';

tpText + = this.tab.top;

tpText + ='';左:'';

tpText + = this.tab.left;

tpText + =''; width:'';

tpText + = this.tab.width;

tpText + =''" onClick =" showPanel(\'''';

tpText + = this.tab.id +''\'',\''''+ this.panel.id;

options_total = eval(form.options_total.value);

....

如果我注释掉最后一行,一切都很好 - 除了

之外,该值显然没有通过。


Matthew Crouch说:


这是一个标签界面,我只是试图在JS中传递
options_total值fxns。我在Javascript控制台中没有输出错误...只是一个没有标签,面板或
表格的空白屏幕。

工作代码:用行调用

updateOptionsTotal({

Please give this code a look. I''m not a JS programmer at all, but I
can''t figure out why identical lines in essentially the same context
work in one place but in the other, it causes the entire interface to
disappear.

This is for a tabbed interface, and I''m just trying to pass the
options_total value around among the JS fxns. I get no error output in
the Javascript Console ... just a blank screen without tabs, panels, or
forms.

Working code: called with the line

updateOptionsTotal({$optionset_id},{$productoption _id},this.form)
function updateOptionsTotal(set_id,new_option_id,form) {
former_option_id = selected_options[set_id];
selected_options[set_id] = new_option_id;

options_total=eval(form.options_total.value);

....

Breaking: (called with the line:
writeTabPanel(this.form);
function writeTabPanel(form){
var tpText = '''';
tpText += ''<div id="'';
tpText += this.tab.id;
tpText += ''" class="tab" style="top:'';
tpText += this.tab.top;
tpText += '';left:'';
tpText += this.tab.left;
tpText += '';width:'';
tpText += this.tab.width;
tpText += ''" onClick="showPanel(\'''';
tpText += this.tab.id + ''\'',\'''' + this.panel.id;
options_total = eval(form.options_total.value);
....
If I comment out this last line, everything works great -- except that
the value obviously isn''t passed.

解决方案

optionset_id},{


productoption _id},this.form)
function updateOptionsTotal(set_id,new_option_id,form) {
former_option_id = selected_options[set_id];
selected_options[set_id] = new_option_id;

options_total=eval(form.options_total.value);

....

Breaking: (called with the line:
writeTabPanel(this.form);
function writeTabPanel(form){
var tpText = '''';
tpText += ''<div id="'';
tpText += this.tab.id;
tpText += ''" class="tab" style="top:'';
tpText += this.tab.top;
tpText += '';left:'';
tpText += this.tab.left;
tpText += '';width:'';
tpText += this.tab.width;
tpText += ''" onClick="showPanel(\'''';
tpText += this.tab.id + ''\'',\'''' + this.panel.id;
options_total = eval(form.options_total.value);
....
If I comment out this last line, everything works great -- except that
the value obviously isn''t passed.


Matthew Crouch said:


Please give this code a look. I''m not a JS programmer at all, but I
can''t figure out why identical lines in essentially the same context
work in one place but in the other, it causes the entire interface to
disappear.

This is for a tabbed interface, and I''m just trying to pass the
options_total value around among the JS fxns. I get no error output in
the Javascript Console ... just a blank screen without tabs, panels, or
forms.

Working code: called with the line

updateOptionsTotal({


这篇关于流程形式变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆