Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why doesn't refreshing Firefox reflect javascript code changes? [duplicate]

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

I am working on a simple dojo comboBox (dijit.form.ComboBox) connected to a dojo.store.Memory. I'm using the latest Netbeans and Glassfish setup, with Firefox 10. My problem is that when I change or comment out code related to the combobox, the changes don't show up when I refresh the web page. I've tried clean/build, rerunning, etc, but commenting out the code seems to do nothing. Firefox seems to be running a cached version of the page, instead of rendering the latest code changes I've made. I don't want to have to clear out the browser cache every time I refresh the page. (What I ultimately want to be able to do is dictate when the autoComplete turns on and off.) Any ideas?

<!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>
like image 276
Ted Avatar asked Feb 08 '12 13:02

Ted


1 Answers

For speed FireFox caches the pages and the external files. To refresh and prevent the pulling the page from cache press Ctrl+F5.

For more see this question.

like image 110
Bakudan Avatar answered Sep 26 '22 18:09

Bakudan