jQuery not working
-
Hello all, I am using the Chrome browser to run a simple html test page containing jQuery code. If I load it from the disk path, it works as expected. If, instead, I use the IIS, then it gives the $ is not defined error. Funny enough, using the incognito mode makes it work :wtf: Any idea about what could be wrong here?
Bogdan Rechi.
-
Hello all, I am using the Chrome browser to run a simple html test page containing jQuery code. If I load it from the disk path, it works as expected. If, instead, I use the IIS, then it gives the $ is not defined error. Funny enough, using the incognito mode makes it work :wtf: Any idea about what could be wrong here?
Bogdan Rechi.
A code sample may help.
Chris J www.redash.org
-
Hello all, I am using the Chrome browser to run a simple html test page containing jQuery code. If I load it from the disk path, it works as expected. If, instead, I use the IIS, then it gives the $ is not defined error. Funny enough, using the incognito mode makes it work :wtf: Any idea about what could be wrong here?
Bogdan Rechi.
Hi, you need to provide your HTML code where you referenced the jQuery in order to investigate the issue. As of now it seems you are missing relative path respect to your application.
-
A code sample may help.
Chris J www.redash.org
Thank you and Shahriar for the answers. There is nothing special with the source code and it is even located in the same directory as the jQuery. I think it is just related to the way Chrome functions, since it works as expected in the incognito mode. Here it is a fragment (relevant, I hope): //... </style> <script type="text/javascript" src="jquery-1.5.min.js"></script> <script type="text/javascript"> var x = 10; $(window).load( // error here, $ unknown function() { console.info("jquery loaded"); testLoad(); }); //...
Bogdan Rechi.
-
Thank you and Shahriar for the answers. There is nothing special with the source code and it is even located in the same directory as the jQuery. I think it is just related to the way Chrome functions, since it works as expected in the incognito mode. Here it is a fragment (relevant, I hope): //... </style> <script type="text/javascript" src="jquery-1.5.min.js"></script> <script type="text/javascript"> var x = 10; $(window).load( // error here, $ unknown function() { console.info("jquery loaded"); testLoad(); }); //...
Bogdan Rechi.
I ran this code without error in Chrome v9.0.597.98 beta without issue under the normal mode. Under firefox and IE it complained about console not not being defined.
<html>
<head>
<script type="text/javascript" src="jquery-1.5.min.js"></script>
<script type="text/javascript">var x = 10;
function testLoad()
{
alert("hi");
}$(window).load( // error here, $ unknown
function()
{
console.info("jquery loaded");
testLoad();
});
</script>
</head>
<body>
<p>Testing jQuery</p>
</body>
</html>Chris J www.redash.org
-
Hello all, I am using the Chrome browser to run a simple html test page containing jQuery code. If I load it from the disk path, it works as expected. If, instead, I use the IIS, then it gives the $ is not defined error. Funny enough, using the incognito mode makes it work :wtf: Any idea about what could be wrong here?
Bogdan Rechi.
You should provide HTML code and also mention Directory structure where are you store .js file, this may helpful to diagnose the problem.:thumbsup:
sunaSaRa Imdadhusen +91 99095 44184 +91 02767 284464
-
Hello all, I am using the Chrome browser to run a simple html test page containing jQuery code. If I load it from the disk path, it works as expected. If, instead, I use the IIS, then it gives the $ is not defined error. Funny enough, using the incognito mode makes it work :wtf: Any idea about what could be wrong here?
Bogdan Rechi.
</pre>
I hope the above information will be helpful. If you have more concerns, please let me know.</x-turndown>