I have function that looks like this:
function foo(item) {
var url = $(item).attr("data-url");
if (url && url.length > 0) {
$(item).load(url);
}
}
This function is triggered by a drop downs .change() event. The load() calls out to an MVC4 Partial View, which returns the html. This all works fine and dandy in Chrome and Firefox, but it doesn't work in IE11 (I haven't tested in older versions of IE since I don't support those in this circumstance). However, as soon as I open the Developer Tools in IE, everything works perfectly; I don't have to do anything besides hit F12 for it to work.
I do not have any "console" code in my js files, the server is pushing back valid HTML, and I can't find any other issues to look into.
I hate to make such an open ended question, but can you give me some advice on what to look for? The only things I could find online were to pull out any "console" code (which I didn't have in the first place).
Any suggestions/guidance is greatly appreciated.
The issue was that IE was caching the results of my calls. IE's Developer Tools (from what I understand) automatically removes caching from a page when it's enabled, which is why my page worked when I tried to debug it in IE. To solve the problem I simply placed the code
$.ajaxSetup({ cache: false });
at the begining of my $(document).ready section. That keeps the page from caching any ajax results and solved my issue.
Why does Firebug say there is No Javascript on this page when there are clearly loads of JavaScript on the page. I even reloaded the page several time to make sure but it still show the same message.
It never used to do that before, but all of a sudden it misbehaves.
Is it because of some configuration issues or because of something else?
As of Firefox version 50, it seems that Firebug will no longer work as Mozilla are migrating to Firefox Devtools. The tab Tools/Web Developer has a 'debugger' option. See this page for a discussion on the migration. Read all the posts dated 19 November for further information.
It seems to me that the option gives less functionality but Firebug per se is never going to be fixed for Firefox 50 and beyond
EDIT 2017 April
This answer is now outdated and I'm not even testing it anymore because I'm no longer using Firebug (a shame, I loved it years ago in a time it was The tool of trade for web developing).
EDIT 2014 November
The original answer is now more than a year outdated due to firebug evolution.
Thanks to #AmadeusDrZaius to keep it on tracks
Answer for outdated firebug versions
For anyone still with this problem after updating Firebug.
Just click Clear Activation List option inside the Firebug menu.
For those who can't find it, note that "Clear Activation List" shows up in the dropdown from the Firebug icon in the toolbar, but not the Tools > Web Developer > Firebug menu.
I guess due to the bug previous hitting your working page it stays listed as "no activate FB for this site please".
I encountered No Javascript on this page after upgrading Firefox to ver 50.0, with Firebug ver 2.0.18. I tried refreshing Firefox, even completely uninstall Firefox and installed again. Nothing works for me.
A couple of hours later, I downgraded Firefox to 49.0.2, and voila, it works right away. I downloaded the old version here.
I tried everything on this list and nothing worked for me except resetting Firefox like so:
https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-problems
I realize there are already 10 answers to this question, but in my case none of them helped. I'm running Firefox version 39.0 and Firebug version 2.0.11. The only fix is to completely restart Firefox (i.e. not just the tab or instance with the problem).
Perhaps it's due to Firefox's over-usage of memory, or maybe there's a bug in Firebug. I can't speak to that, but what I do know is it didn't work. I killed Firefox, opened the exact same page again with no changes made and now it works. This has happened to me numerous times and a complete restart always fixes it, but that's the only thing that does.
Since Firefox 49.0 and Firebug 2.0.18 the Script panel is broken. This is due to some internal Firefox API changes. And because Firebug is officially discontinued, this unfortunately won't get fixed anymore.
There was also a bug in Firebug 2.0.11 (and below) in combination with Firefox 39.0 causing this problem. This bug is filed as issue 7918.
It happens when the Script panel is enabled and you close Firebug and reopen it.
You can see two related error messages logged to the Browser Console (can be opened via Ctrl+Shift+J or Firebug menu > Developer > Browser Console):
error occurred while processing 'attach: TypeError: docShell is null
Stack: getChildDocShells#resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webbrowser.js:53:7
...
and
onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'attach: TypeError: docShell is null\nStack: getChildDocShells#resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webbrowser.js:53:7
...
Solution:
The only solution until this bug is fixed is to restart Firefox completely.
Similar things have happened to me because I forgot to add the closing tag.
DON'T do this:
<script src="some.url" type="text/javascript">
or
<script src="some.url" type="text/javascript"/>
DO this instead:
<script src="some.url" type="text/javascript"></script>
The same problem just happened to me. I thought that it was a problem in my scripts, but I checked google.com and the problem persisted.
My problem was that I had updated my version of FF and kept the old version of FireBug. When I updated FireBug and everything was solved.
From firefox 49, the fire bug will be built in and it is called fire-bug next. So the fire bug add on won't work properly and no issues will be solved. So you can use firefox inspector. See here for details information
If the problem only shows up on a single page, check that your script folder is referenced from current folder (".") or that's reachable from the server root ("/").
<script src="./scripts/pagescripts.js" type="text/javascript"></script>
may not be the same as
<script src="/scripts/pagescripts.js" type="text/javascript"></script>
As mentioned, sometimes there's a Javascript syntax error that invalidates the whole script. But I have also had this, and simply opening up the page in a new tab or window and refreshing firebug (disable, enable) gets the javascript to show up again.
One time this caught me out was when I published one of my sites and I was checking it out. No Javascript was working, there were no errors in the console and firebug showed no scripts.
It turned out that in that instance, I'd forgotten to allow the site in NoScript - so there really were no scripts being loaded.
Not sure if that's the problem you're facing but it's worth being aware of.
I also got this error when attempting to use Ajax to a different server than the one serving up the page. JavaScript only allows Ajax access to the server that served up the page.
This problem is STILL happening (Aug 2015) with Firefox 39.0.3 and Firebug 2.0.11
For people saying the code is wrong or missing end tags etc. all I did to get all the javascript to reappear in tab was to shut down Firefox and restart it. I didn't change anything. Also that "Clear Activation List" option didn't work (no idea what that means)
I upvoted #Tom_Thomson's answer above, but I am wondering if simply removing and then reinstalling the Firebug add-on might not have accomplished the same thing without losing all the other stuff like bookmarks.
FWIW this problem is still happening in August 2016. I'm using Firebug 2.0.17 with Firefox Dev Edition 50.0a2.
As a workaround, I'm able to use the Developer Tools, though they are not as robust as Firebug (when it's working).
Well Firefox native Inspector is good... I know that you will miss some things, but in general we can survive with it. The good news is... less one addon, FF will be faster :)
I am using Aurora 14.0a2 as my default browser (its the early release of firefox)
I have went into my about:config and have changed the value of services.sync.prefs.sync.dom.disable_window_move_resize; to false
Yet when I run my website the resizeTo(); function still doesn't work
here is my code:
jsfiddle_link
function onload(){
window.resizeTo(600,800);
}
I also tried it in other browsers:
Chrome (no surprise it didn't work since chrome never supports it)
opera
IE 8
Safari
None of which worked
I also tried making a link from a different website linking my website then clicking on it but it did not do the trick
any ideas?
I think the resize functionality of javascript would only work when you open it on popup windows and not when your openning it on a main browser window try checking on this link http://www.javascripter.net/faq/windowresizeto.htm it has the sample that I think would help you.
I'm experiencing a very weird Javascript bug in Chrome.
I've made a website for a client in which the site's background images change as you scroll down. In addition, there's a subtle cross-fade effect between the previous background image and the next one.
Everything works fine in most recent browsers, except for Chrome. Weirder than that: in works in Chrome's incognito mode, but not in the "standard"/initial mode of Chrome. My first reflex was of course to delete all of the browser's data and restart Chrome, but this strangely doesn't fix the problem.
Here is the site's URL: http://pedropiresfilms.com/index.php
Thank you for your time.
Since you already cleared the data, I would guess its because of some extensions that prevent your script from running. In incognito mode, all of them are disabled and your script works.
And further your site works at our end on chrome, so its for sure some addon.
This is just a cache issue on your end. Your page works fine for me. Try Control+F5.
Your suspicions were correct... by using Incognito Mode, you essentially get a clean session and empty cache.
You can also test this with an extension I wrote that will launch a new Chrome window with empty cache and empty cookies:
http://www.musatcha.com/software/NewChromeSession/
If the cache issue doesn't work, make sure you have no plugins interfering
I have the same issue. In my configuration the Chrome Touch Extension is producing the error. After disabling it, everything works fine
If nothing else helps - reinstall Chrome.
In my case I tried clearing all caches, uninstalling all extensions, disabling antivirus but only reinstall solved this issue.
Interestingly issue was happening only to specific user account on Chrome, everything worked fine in incognito, other account and other browsers.
I have a web page with javascript in it, everywhere it runs fine except ie8. When I load on IE8 my javascript is missing, so I turn on the developer tools and javascript console to debug it, refresh, and my javascript loads. It seems it only loads when I have previously enabled the JavaScript console.
Can anybody shed some light on this? You can view the page here
http://www.orchestra-agency.com/contentviewer_beta.php?cv=ORC_TWL_01&p=0
Does the page make any console calls, like console.log('foo'), without first making sure that console and console.log are defined?
A simple workaround: log() – A lightweight wrapper for console.log
More powerful version: JavaScript Debug: A simple wrapper for console.log
Does it work in FF without Firebug enabled? If not, I'd bet it's the console.log's that cause it.
Try loading this on the page header
<script type="text/javascript">
// IE fix
if(!window.console) {
var console = {
log : function(){},
warn : function(){},
error : function(){},
time : function(){},
timeEnd : function(){}
}
}
</script>
It removes the functionality of any console code you have. If it fixes the problem, you have to find and clean all of them from your code...
This happens when the browser tries to output to the console but it doesn't exist so it throws an exception and blocks all further javascript.... :S