gpt4 book ai didi

javascript - 为什么刷新 Firefox 不反射(reflect) javascript 代码更改?

转载 作者:搜寻专家 更新时间:2023-11-01 04:19:44 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Making sure a web page is not cached, across all browsers

我正在开发一个连接到 dojo.store.Memory 的简单 dojo 组合框 (dijit.form.ComboBox)。我正在使用最新的 Netbeans 和 Glassfish 设置,以及 Firefox 10。我的问题是,当我更改或注释掉与组合框相关的代码时,这些更改不会在我刷新网页时显示出来。我试过清理/构建、重新运行等,但注释掉代码似乎无济于事。 Firefox 似乎正在运行页面的缓存版本,而不是呈现我所做的最新代码更改。我不想每次刷新页面时都必须清除浏览器缓存。 (我最终想要做的是指示自动完成功能何时打开和关闭。)有什么想法吗?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js" type="text/javascript" ></script>
    <script type="text/javascript">
dojo.require("dijit.form.ComboBox");
dojo.require("dojo.store.Memory");

var myBox, store;
dojo.ready(function(){makeComboBox();});

function makeComboBox(){

store = new dojo.store.Memory({
data: [
{name:"Alabama", id:"AL"},
{name:"Alaska", id:"AK"},
{name:"American Samoa", id:"AS"},
{name:"Arizona", id:"AZ"},
{name:"Arkansas", id:"AR"},
{name:"Armed Forces Europe", id:"AE"},
{name:"Armed Forces Pacific", id:"AP"},
{name:"Armed Forces the Americas", id:"AA"},
{name:"California", id:"CA"},
{name:"Colorado", id:"CO"},
{name:"Connecticut", id:"CT"},
{name:"Delaware", id:"DE"}
]
});

myBox = new dijit.form.ComboBox({
id: "stateSelect",
name: "state",
//value: "Alabama",
//store: store, <-- the box is still connected to the store,
<--even if I comment it out
searchAttr:"name"
}, "stateSelect");
//myBox.set("autoComplete", "false"); <-- this doesn't work either
}
</script>

<div id="myDiv" >
<input id="stateSelect" >
<p><button onClick="alert(dijit.byId('stateSelect').get('value'))">get value</button></p>
</div>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com