Cant find the problem, IE appearance problem - javascript

I have this ajax_update script that updates file.php every 60 seconds.. Now file.php outputs this after updated a table:
<div id="message" style="display: none;" onclick="closeNotice()">this works
</div>
What I am trying to do is that after file.php have updated a field in the database(points), there will come up a message like stackoverflow at the top(just like when you earn a badge) saying that you have received 1 point. anyway:
Here's my update script:
function addpoints() {
var postFile = 'addpoints.php?userid='+ $('#user_id_points').val();
$.post(postFile, function(data){
$("#points").html(data).find("#message").fadeIn("slow")
setTimeout(addpoints, 5000);
});
}
Now, i have in my index.php, and a load function addpoints script..
But why will this only appear in FF and not in IE?
I have checked with w3c validator, if it could be unclosed tags or something, i fixed all problems and now i have no errors, but still it doesnt work.
So what to do?
You can see my site here: http://azzyh.dk/newgen/area/member/indextest.php
(use FF and you will see the message at the top, use IE and you wont see anything)
Im pretty lost. thank you

Display issues in IE can be a really pain i cant help you directly, But firebug lite which can be plugged into any broswer should help you see whats going on in IE
Firebug Lite
If you add the following as a bookmark and stick it on your tool bar it will enable firebug lite off any webpage with a single click.
javascript:var%20firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init();}else{setTimeout(arguments.callee);}})();void(firebug);

Related

rails 4.2 tinyMCE gem produces failed to load content css skins/lightgray/content.min.css

I just introduced tinyMCE into my rails 4.2.8 site to let manage formatted text in articles. Everything works fine actually but now and then a warning message produced by tinyMCE comes up such as "failed to load content css: http://myurl/assets/tinymce/skins/lightgray/content.min.css" but if a look at the debug console in firefox I see that url has perfectly found and loaded content.min.css.
When the warning message is there I can't enter anything in the textarea but the situation is fixed by reloading the page, then the rich text can be nicely entered and the relevant data is loaded correctly into the backend DB via relevant input form.
I don't understand the reason why tinyMCE is signalling such a warning despite the fact that the css file was actually found.
Any idea? Thanks and kind regards
Vincenzo
**** update on June 8th 2017 ****
Now I can better explain what's actually going on.
1) the problem shows up in Firefox v.53, if I use Chrome everything works fine
2) I am using tinyMCE in three distinct forms: one for new articles, one for editing, one for comments.
3) If I insert a few new articles no problem appears, the problem shows up just chenging the form in use: i.e. after insertion an article I try editing it or another one or else I try to insert a comment after havine inserted a new article. After the error message has shown I can always recover by reloading the page and no error appears eventually.
I guess there is some caching problem specifically in Firefox since all works fine in Chrome. I will try Windows Edge too..
2017/06/10
Tried Windows Edge on Win10: it works fine too.
2017/06/14
In the meantime I opened bug 1371910 at https://bugzilla.mozilla.org/show_bug.cgi?id=1371910#c5 a few days ago and the result was:
QUOTE
Hi Vincenzo,
Thanks for sending us the link. Unfortunately this seems to be a problem with tinyMCE rather than Firefox.
The initial load of content.min.css works correctly, and no other attempts to reload it seem to be made.
If it works in other browsers it is probably due to the developers doing things differently.
If you still think this is a bug in Firefox, please reopen this bug, and send us a smaller test case.
PS. Others seem to be having the same problem as you: https://community.tinymce.com/communityQuestion?id=90661000000Qct9AAC
I hope you find a way to fix it.
UNQUOTE
What the Firefox support says makes sense since I too whatched the content.min.css file was actually loaded by the browser so in must be tinyMCE to misinterpret something. Anyway I am still in the soup...
Whoever might have some interest at this issue please hava a look at:
http://vinloren-learn-rails.herokuapp.com/articles accessing this endpoint with Firefox v52..v54 the click show any article then going back via the 'back' link at the end of the article's content.

Can't debug greasemonkey script using firebug or firefox debugger

I found two posts on this but still doesn't seem to be working. I don't see the user.js script in the drop down menu on either firebug or the built-in firefox debugger. I'm still just learning coding and couldn't figure out the workaround strategies. Any help would be greatly appreciated.
How to debug Greasemonkey script on Firefox 30?
How to debug Greasemonkey script with the Firebug extension?
Firefox 35.0
The only way I've found to debug greasemonkey scripts is to use the browser console to get clues and then add alerts in my code where I think the problem is... then if the alert doesn't show up I know the problem is earlier in the code. My code usually ends up looking kinda like this pseudo code:
var i = get.value.from.page
alert(i)
do stuff to i
alert(i)
if (i===5){
do this stuff
alert ("i equaled 5")
}
else{
do this stuff instead
alert("i didn't equal 5, it equaled "+i)
}
Yeah, it's messy and time consuming... but it works.

Firebug says "No Javascript on this page", even though JavaScript does exist on the page

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 :)

firebug script panel not showing any scripts

I am trying to debug my javascript & jQuery and step through it using firebug.
I am running my code on an Apache server (2.4) on a windows machine.
I used the firefox browser version 18.
When i go to run my code, I can't see my javascript (external file) in the scripts panel.
I see the linked jQuery library on the panel but I dont see my javascript code.
On the Firebug, the scripts are clearly linked in the HTML panel. But on the script panel, only the jQuery.js is visible. i would post a screen shot but i dont have enough reputation right now.
I dont know what is going on and what i have to do in order to be able to step through my javascript code.
UPDATE
I placed the "debugger" on my javascript code but it still not showing on the 'script panel'.
debugger;
$(document).ready(function () {
var email_default = "Enter your email address...";
$(':input[type="email"]').val(email_default).on('focus', function () {
if ($(this).val() == email_default) {
$(this).val(' ');
}
});
I also tried to do a browser refresh, disable and re-enable all the firebug panels- but it still won't show my external javascript. I had also double checked my file location & directories to make sure i am linking it correctly.
If Firebug (or other browser developer tools) doesn't show a JavaScript in the list of available scripts, this means it has a syntax error.
In that case you need to switch to the Console panel and check there for the error.
Notes:
As mentioned in a related answer, there can also be other reasons why there are no scripts shown in the list:
Since Firefox 49.0 and Firebug 2.0.18 the Script panel is completely 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 got filed as issue 7918 and fixed for version 2.0.12.
It happens when the Script panel is enabled and you close Firebug and then reopen it.

IE6 Won't Display a Javascript Tooltip... how do you even begin to debug this?

I am using a tooltip plugin (developed in house by someone who is on vacation) that works everywhere but in IE6. Naturally, it is being used on a site by people that use only IE6 so I need to find a way to get it displaying.
How would you even start to debug such a thing? I've Googled for the problem to see what other javascript tooltip plugins have done to deal with this but cannt find anything that pertains or solves my problem. So, I would love to debug it myself but I really don't know where to begin!
How would you start trying to crack this nut?
Some code:
In the html we insert the following (with display:none set in the css)...
var noteContainer =
'<div style="float:left;" class="ttip-container">
<div class="ttip-box">
(<a class="ttip_heading" href="javascript:void(0)">notes</a>)
<div class="ttip" style="background-color:#ffffff;">
<h3>Notes</h3>
<div class="subhead">' + noteMessage + '</div>
<div class="subhead_bottom">Click <em>(notes)</em> to ' + actionCap + '</div>
<img class="point" src="img/hovertip.gif" width="18" height="14" />
</div>
</div>
</div>';
Then the plugin sets this to diplay:block on hover over an anchor link.
So... where would you start debugging an IE6 javascript issue? I have IE6 running in a VM so I can work with it... just can't get it to tell me anything about what might be going on.
Install the IE developer toolbar, and install Visual Web Developer Express (which has a real debugger)
Is the HTML actually being inserted into the DOM properly? If there's a parsing error the DOM methods in IE will choke (can't insert invalid HTML in IE6). This is step 1. Make sure the markup is actually there (view source is fine).
Then see if your event is firing: put an alert inside the (presumably) click handler. See if your css-changing function is actually firing.
Then see if your css-changing function has a handle on the object. Try something like alert(this.tagName) (or e.tagName, or however else you might have a handle on the element to show/hide).
Let us know how those go.
In this case, I would use the IE Developer Toolbar to see if the HTML was properly appended to the document. If it is, then we know that the problem is not with the statement you pasted into your question. If it's not in your document (in which case you're probably receiving a script error), I would try gutting your tooltip's HTML string to
var noteContainer = '<div style="float:left;" class="ttip-container"></div>';
Test if that's appended correctly. If so, progressively add more of the tooltip content until you get your error. At that point you'll have a much better idea of what is causing IE6's parsing error.
In general, 'Old school' debugging in IE6-7 using alert() is still effective in many situations.
Visual Studio and Visual Web Developer Express are great options, but they're a little heavy on the system resource side, and could be annoying to work with in a virtual machine.
Getting IE to work with JS that works in every other browser is a major pain, so my sympathies for that.
What I would do in a case like this is crack open the source that's actually generating and displaying the tooltip on the page. Throw some alerts in there or change document.title at different points in the code. See if it's even making it to the portions where a tooltip should be appearing.
If it is making it to the "rendering" stages of the code, change your debug setup to tell you what's inside the tooltip element, what the element's size is, etc. As much information about the tooptip container as you can gather. Something in there might stick out, like an element with 0 width/height or completely missing data.
Basically, I'd try to narrow it down to either a "data pulling" or "rendering" problem.

Categories

Resources